public enum MinguoEra extends java.lang.Enum<MinguoEra> implements Calendrical
Do not use ordinal() to obtain the numeric representation of a MinguoEra instance. Use getValue() instead.
MinguoEra is immutable and thread-safe.
Enum Constant and Description |
---|
BEFORE_MINGUO
The singleton instance for the era before the current one - Before Minguo -
which has the value 0.
|
MINGUO
The singleton instance for the current era - Minguo - which has the value 1.
|
Modifier and Type | Method and Description |
---|---|
static MinguoEra |
from(Calendrical calendrical)
Obtains an instance of
MinguoEra 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 MinguoEra |
of(int minguoEra)
Obtains an instance of
MinguoEra from a value. |
static DateTimeFieldRule<MinguoEra> |
rule()
Gets the rule that defines how the era field operates.
|
static MinguoEra |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static MinguoEra[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MinguoEra BEFORE_MINGUO
public static final MinguoEra MINGUO
public static MinguoEra[] values()
for (MinguoEra c : MinguoEra.values()) System.out.println(c);
public static MinguoEra 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<MinguoEra> rule()
The rule provides access to the minimum and maximum values, and a generic way to access values within a calendrical.
public static MinguoEra of(int minguoEra)
MinguoEra
from a value.
The current era (from ISO year 1912 onwards) has the value 1 The previous era has the value 0.
minguoEra
- the era to represent, from 0 to 1IllegalCalendarFieldValueException
- if the era is invalidpublic static MinguoEra from(Calendrical calendrical)
MinguoEra
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 1912 onwards) has the value 1 The previous era has the value 0.