Enum Class Fields.Month

java.lang.Object
java.lang.Enum<Fields.Month>
org.miaixz.bus.core.lang.Fields.Month
All Implemented Interfaces:
Serializable, Comparable<Fields.Month>, Constable
Enclosing class:
Fields

public static enum Fields.Month extends Enum<Fields.Month>
月份枚举 与Calendar中的月份int值对应
See Also:
  • Enum Constant Details

  • Method Details

    • values

      public static Fields.Month[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Fields.Month valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static Fields.Month of(int calendarMonthIntValue)
      Calendar月份相关值转换为Month枚举对象 未找到返回null
      Parameters:
      calendarMonthIntValue - Calendar中关于Month的int值,从0开始
      Returns:
      Month
      See Also:
    • of

      public static Fields.Month of(String name) throws IllegalArgumentException
      解析别名为Month对象,别名如:jan或者JANUARY,不区分大小写
      Parameters:
      name - 别名值
      Returns:
      月份枚举Month,非空
      Throws:
      IllegalArgumentException - 如果别名无对应的枚举,抛出此异常
    • of

      public static Fields.Month of(Month month)
      Month转换为Month对象
      Parameters:
      month - Month
      Returns:
      Month
    • getLastDay

      public static int getLastDay(int month, boolean isLeapYear)
      获得指定月的最后一天
      Parameters:
      month - 月份,从0开始
      isLeapYear - 是否为闰年,闰年只对二月有影响
      Returns:
      最后一天,可能为28,29,30,31
    • getValue

      public int getValue()
      获取Calendar中的对应值 此值从0开始,即0表示一月
      Returns:
      Calendar中的对应月份值,从0开始计数
    • getValueBaseOne

      public int getValueBaseOne()
      获取月份值,此值与Month对应 此值从1开始,即1表示一月
      Returns:
      月份值,对应Month,从1开始计数
    • getLastDay

      public int getLastDay(boolean isLeapYear)
      获取此月份最后一天的值 不支持 UNDECIMBER
      Parameters:
      isLeapYear - 是否闰年
      Returns:
      此月份最后一天的值
    • toJdkMonth

      public Month toJdkMonth()
      转换为Month
      Returns:
      Month
    • getDisplayName

      public String getDisplayName(TextStyle style)
      获取显示名称
      Parameters:
      style - 名称风格
      Returns:
      显示名称
    • getDisplayName

      public String getDisplayName(TextStyle style, Locale locale)
      获取显示名称
      Parameters:
      style - 名称风格
      locale - Locale
      Returns:
      显示名称