public enum DateTimeUnit extends java.lang.Enum<DateTimeUnit>
Enum Constant and Description |
---|
DAYS |
HOURS |
MINUTES |
MONTHS |
SECONDS |
YEARS |
Modifier and Type | Method and Description |
---|---|
int |
getCalendarField() |
java.time.temporal.TemporalUnit |
toTemporalUnit() |
static DateTimeUnit |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static DateTimeUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DateTimeUnit SECONDS
public static final DateTimeUnit MINUTES
public static final DateTimeUnit HOURS
public static final DateTimeUnit DAYS
public static final DateTimeUnit MONTHS
public static final DateTimeUnit YEARS
public static DateTimeUnit[] values()
for (DateTimeUnit c : DateTimeUnit.values()) System.out.println(c);
public static DateTimeUnit valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic int getCalendarField()
public java.time.temporal.TemporalUnit toTemporalUnit()