Enum Class Fields.Week

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

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

    • SUNDAY

      public static final Fields.Week SUNDAY
      周日
    • MONDAY

      public static final Fields.Week MONDAY
      周一
    • TUESDAY

      public static final Fields.Week TUESDAY
      周二
    • WEDNESDAY

      public static final Fields.Week WEDNESDAY
      周三
    • THURSDAY

      public static final Fields.Week THURSDAY
      周四
    • FRIDAY

      public static final Fields.Week FRIDAY
      周五
    • SATURDAY

      public static final Fields.Week SATURDAY
      周六
  • Method Details

    • values

      public static Fields.Week[] 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.Week 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.Week of(int calendarWeekIntValue)
      Calendar星期相关值转换为Week枚举对象
      Parameters:
      calendarWeekIntValue - Calendar中关于Week的int值,1表示Sunday
      Returns:
      Week
      See Also:
    • of

      public static Fields.Week of(String name) throws IllegalArgumentException
      解析别名为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

      public static Fields.Week of(DayOfWeek dayOfWeek)
      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

      public String toChinese()
      转换为中文名
      Returns:
      星期的中文名
    • toChinese

      public String toChinese(String weekNamePre)
      转换为中文名
      Parameters:
      weekNamePre - 表示星期的前缀,例如前缀为“星期”,则返回结果为“星期一”;前缀为”周“,结果为“周一”
      Returns:
      星期的中文名
    • toJdkDayOfWeek

      public DayOfWeek toJdkDayOfWeek()
      转换为DayOfWeek
      Returns:
      DayOfWeek