Module java.base

Class JapaneseEra

java.lang.Object
java.time.chrono.JapaneseEra
All Implemented Interfaces:
Serializable, Era, TemporalAccessor, TemporalAdjuster

public final class JapaneseEra extends Object implements Era, Serializable
An era in the Japanese Imperial calendar system.

The Japanese government defines the official name and start date of each era. Eras are consecutive and their date ranges do not overlap, so the end date of one era is always the day before the start date of the next era.

The Java SE Platform supports all eras defined by the Japanese government, beginning with the Meiji era. Each era is identified in the Platform by an integer value and a name. The of(int) and valueOf(String) methods may be used to obtain a singleton instance of JapaneseEra for each era. The values() method returns the singleton instances of all supported eras.

For convenience, this class declares a number of public static final fields that refer to singleton instances returned by the values() method.

API Note:
The fields declared in this class may evolve over time, in line with the results of the values() method. However, there is not necessarily a 1:1 correspondence between the fields and the singleton instances., The Japanese government may announce a new era and define its start date but not its official name. In this scenario, the singleton instance that represents the new era may return a name that is not stable until the official name is defined. Developers should exercise caution when relying on the name returned by any singleton instance that does not correspond to a public static final field.
Implementation Requirements:
This class is immutable and thread-safe.
Since:
1.8
See Also: