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