DayOfWeek
public
final
enum
DayOfWeek
extends Enum<DayOfWeek>
implements
TemporalAccessor,
TemporalAdjuster
| java.lang.Object | ||
| ↳ | java.lang.Enum<java.time.DayOfWeek> | |
| ↳ | java.time.DayOfWeek | |
A day-of-week, such as 'Tuesday'.
DayOfWeek is an enum representing the 7 days of the week -
Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday.
In addition to the textual enum name, each day-of-week has an int value.
The int value follows the ISO-8601 standard, from 1 (Monday) to 7 (Sunday).
It is recommended that applications use the enum rather than the int value
to ensure code clarity.
This enum provides access to the localized textual form of the day-of-week.
Some locales also assign different numeric values to the days, declaring
Sunday to have the value 1, however this class provides no support for this.
See WeekFields for localized week-numbering.
Do not use ordinal() to obtain the numeric representation of DayOfWeek.
Use getValue() instead.
This enum represents a common concept that is found in many calendar systems. As such, this enum may be used by any calendar system that has the day-of-week concept defined exactly equivalent to the ISO calendar system.
Summary
Enum values | |
|---|---|
DayOfWeek |
FRIDAY
The singleton instance for the day-of-week of Friday. |
DayOfWeek |
MONDAY
The singleton instance for the day-of-week of Monday. |
DayOfWeek |
SATURDAY
The singleton instance for the day-of-week of Saturday. |
DayOfWeek |
SUNDAY
The singleton instance for the day-of-week of Sunday. |
DayOfWeek |
THURSDAY
The singleton instance for the day-of-week of Thursday. |
DayOfWeek |
TUESDAY
The singleton instance for the day-of-week of Tuesday. |
DayOfWeek |
WEDNESDAY
The singleton instance for the day-of-week of Wednesday. |
Public methods | |
|---|---|
Temporal
|
adjustInto(Temporal temporal)
Adjusts the specified temporal object to have this day-of-week. |
static
DayOfWeek
|
from(TemporalAccessor temporal)
Obtains an instance of |
int
|
get(TemporalField field)
Gets the value of the specified field from this day-of-week as an |
String
|
getDisplayName(TextStyle style, Locale locale)
Gets the textual representation, such as 'Mon' or 'Friday'. |
long
|
getLong(TemporalField field)
Gets the value of the specified field from this day-of-week as a |
int
|
getValue()
Gets the day-of-week |
boolean
|
isSupported(TemporalField field)
Checks if the specified field is supported. |
DayOfWeek
|
|