Enum DayOfWeek

All Implemented Interfaces:
Comparable<DayOfWeek>, TemporalAccessor

public enum DayOfWeek extends Enum<DayOfWeek> implements TemporalAccessor
The seven days of the week, Monday first as ISO counts them.
  • Enum Constant Details

    • MONDAY

      public static final DayOfWeek MONDAY
      Monday, day 1.
    • TUESDAY

      public static final DayOfWeek TUESDAY
      Tuesday, day 2.
    • WEDNESDAY

      public static final DayOfWeek WEDNESDAY
      Wednesday, day 3.
    • THURSDAY

      public static final DayOfWeek THURSDAY
      Thursday, day 4.
    • FRIDAY

      public static final DayOfWeek FRIDAY
      Friday, day 5.
    • SATURDAY

      public static final DayOfWeek SATURDAY
      Saturday, day 6.
    • SUNDAY

      public static final DayOfWeek SUNDAY
      Sunday, day 7.
  • Method Details

    • values

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

      public static DayOfWeek valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static DayOfWeek of(int dayOfWeek)
      The day numbered dayOfWeek, 1 for Monday to 7 for Sunday.
    • getValue

      public int getValue()
      1 for Monday to 7 for Sunday.
    • plus

      public DayOfWeek plus(long days)
      The day days later, around the week.
    • minus

      public DayOfWeek minus(long days)
      The day days earlier, around the week.