Package org.miaixz.bus.core.lang
Enum Class Fields.Month
- All Implemented Interfaces:
Serializable,Comparable<Fields.Month>,Constable
- Enclosing class:
Fields
月份枚举
与Calendar中的月份int值对应
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptiongetDisplayName(TextStyle style) 获取显示名称getDisplayName(TextStyle style, Locale locale) 获取显示名称intgetLastDay(boolean isLeapYear) 获取此月份最后一天的值 不支持UNDECIMBERstatic intgetLastDay(int month, boolean isLeapYear) 获得指定月的最后一天intgetValue()获取Calendar中的对应值 此值从0开始,即0表示一月int获取月份值,此值与Month对应 此值从1开始,即1表示一月static Fields.Monthof(int calendarMonthIntValue) 将Calendar月份相关值转换为Month枚举对象 未找到返回nullstatic Fields.Month解析别名为Month对象,别名如:jan或者JANUARY,不区分大小写static Fields.MonthMonth转换为Month对象转换为Monthstatic Fields.MonthReturns the enum constant of this class with the specified name.static Fields.Month[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
JANUARY
一月 -
FEBRUARY
二月 -
MARCH
三月 -
APRIL
四月 -
MAY
五月 -
JUNE
六月 -
JULY
七月 -
AUGUST
八月 -
SEPTEMBER
九月 -
OCTOBER
十月 -
NOVEMBER
十一月 -
DECEMBER
十二月 -
UNDECIMBER
十三月,仅用于农历
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
of
将Calendar月份相关值转换为Month枚举对象 未找到返回null- Parameters:
calendarMonthIntValue- Calendar中关于Month的int值,从0开始- Returns:
- Month
- See Also:
-
of
解析别名为Month对象,别名如:jan或者JANUARY,不区分大小写- Parameters:
name- 别名值- Returns:
- 月份枚举Month,非空
- Throws:
IllegalArgumentException- 如果别名无对应的枚举,抛出此异常
-
of
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
转换为Month- Returns:
Month
-
getDisplayName
获取显示名称- Parameters:
style- 名称风格- Returns:
- 显示名称
-
getDisplayName
获取显示名称- Parameters:
style- 名称风格locale-Locale- Returns:
- 显示名称
-