public enum ThaiBuddhistEra extends java.lang.Enum<ThaiBuddhistEra> implements Calendrical
Do not use ordinal() to obtain the numeric representation of a ThaiBuddhistEra instance. Use getValue() instead.
ThaiBuddhistEra is immutable and thread-safe.
Enum Constant and Description |
---|
BEFORE_BUDDHIST
The singleton instance for the era before the current one - Before Buddhist -
which has the value 0.
|
BUDDHIST
The singleton instance for the current era - Buddhist - which has the value 1.
|
Modifier and Type | Method and Description |
---|---|
static ThaiBuddhistEra |
from(Calendrical calendrical)
Obtains an instance of
ThaiBuddhistEra from a calendrical. |
<T> T |
get(CalendricalRule<T> rule)
Gets the value of the specified calendrical rule.
|
int |
getValue()
Gets the era numeric value.
|
static ThaiBuddhistEra |
of(int thaiBuddhistEra)
Obtains an instance of
ThaiBuddhistEra from a value. |
static DateTimeFieldRule<ThaiBuddhistEra> |
rule()
Gets the rule that defines how the era field operates.
|
static ThaiBuddhistEra |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ThaiBuddhistEra[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ThaiBuddhistEra BEFORE_BUDDHIST
public static final ThaiBuddhistEra BUDDHIST
public static ThaiBuddhistEra[] values()
for (ThaiBuddhistEra c : ThaiBuddhistEra.values()) System.out.println(c);
public static ThaiBuddhistEra 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 static DateTimeFieldRule<ThaiBuddhistEra> rule()
The rule provides access to the minimum and maximum values, and a generic way to access values within a calendrical.
public static ThaiBuddhistEra of(int thaiBuddhistEra)
ThaiBuddhistEra
from a value.
The current era (from ISO year -543 onwards) has the value 1 The previous era has the value 0.
thaiBuddhistEra
- the era to represent, from 0 to 1IllegalCalendarFieldValueException
- if the era is invalidpublic static ThaiBuddhistEra from(Calendrical calendrical)
ThaiBuddhistEra
from a calendrical.
This can be used extract the era directly from any implementation of Calendrical, including those in other calendar systems.
calendrical
- the calendrical to extract from, not nullUnsupportedRuleException
- if the era cannot be obtainedpublic <T> T get(CalendricalRule<T> rule)
This method queries the value of the specified calendrical rule.
If the value cannot be returned for the rule from this instance then
null
will be returned.
get
in interface Calendrical
rule
- the rule to use, not nullpublic int getValue()
The current era (from ISO year -543 onwards) has the value 1 The previous era has the value 0.