Package org.miaixz.bus.core.lang
Enum Class Fields.Week
- All Implemented Interfaces:
Serializable,Comparable<Fields.Week>,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 TypeMethodDescriptionint获取ISO8601规范的int值,from 1 (Monday) to 7 (Sunday).intgetValue()获得星期对应Calendar中的Week值static Fields.Weekof(int calendarWeekIntValue) 将Calendar星期相关值转换为Week枚举对象static Fields.Week解析别名为Week对象,别名如:sun或者SUNDAY,不区分大小写 参考:https://github.com/sisyphsu/dateparser/blob/master/src/main/java/com/github/sisyphsu/dateparser/DateParser.java#L319static Fields.Week将DayOfWeek星期相关值转换为Week枚举对象转换为中文名转换为中文名转换为DayOfWeekstatic Fields.WeekReturns the enum constant of this class with the specified name.static Fields.Week[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SUNDAY
周日 -
MONDAY
周一 -
TUESDAY
周二 -
WEDNESDAY
周三 -
THURSDAY
周四 -
FRIDAY
周五 -
SATURDAY
周六
-
-
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星期相关值转换为Week枚举对象- Parameters:
calendarWeekIntValue- Calendar中关于Week的int值,1表示Sunday- Returns:
- Week
- See Also:
-
of
解析别名为Week对象,别名如:sun或者SUNDAY,不区分大小写 参考:https://github.com/sisyphsu/dateparser/blob/master/src/main/java/com/github/sisyphsu/dateparser/DateParser.java#L319- Parameters:
name- 别名值- Returns:
- 周枚举Week,非空
- Throws:
IllegalArgumentException- 如果别名无对应的枚举,抛出此异常
-
of
将DayOfWeek星期相关值转换为Week枚举对象- Parameters:
dayOfWeek- DayOfWeek星期值- Returns:
- Week
- See Also:
-
getValue
public int getValue()获得星期对应Calendar中的Week值- Returns:
- 星期对应
Calendar中的Week值
-
getIso8601Value
public int getIso8601Value()获取ISO8601规范的int值,from 1 (Monday) to 7 (Sunday).- Returns:
- ISO8601规范的int值
-
toChinese
转换为中文名- Returns:
- 星期的中文名
-
toChinese
转换为中文名- Parameters:
weekNamePre- 表示星期的前缀,例如前缀为“星期”,则返回结果为“星期一”;前缀为”周“,结果为“周一”- Returns:
- 星期的中文名
-
toJdkDayOfWeek
转换为DayOfWeek- Returns:
DayOfWeek
-