Top Description Fields Constructors Methods
java.time.chrono

public final Enum ThaiBuddhistEra

extends Enum<ThaiBuddhistEra>
implements Era
Class Inheritance
All Implemented Interfaces
java.time.chrono.Era, java.time.temporal.TemporalAdjuster, java.time.temporal.TemporalAccessor
Static Imports
java.time.temporal.ChronoField.ERA

An era in the Thai Buddhist calendar system.

The Thai Buddhist calendar system has two eras. The current era, for years from 1 onwards, is known as the 'Buddhist' era. All previous years, zero or earlier in the proleptic count or one and greater in the year-of-era count, are part of the 'Before Buddhist' era.

Buddhist years and eras
year-of-era era proleptic-year ISO proleptic-year
2BE2-542
1BE1-543
1BEFORE_BE0-544
2BEFORE_BE-1-545

Do not use ordinal() to obtain the numeric representation of ThaiBuddhistEra. Use getValue() instead.

Implementation Specification

This is an immutable and thread-safe enum.

Since
1.8

Field Summary

Modifier and TypeField and Description
public static final ThaiBuddhistEra
BE

The singleton instance for the current era, 'Buddhist Era', which has the numeric value 1.

public static final ThaiBuddhistEra
BEFORE_BE

The singleton instance for the era before the current one, 'Before Buddhist Era', which has the numeric value 0.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
getDisplayName(TextStyle
the style of the text required, not null
style
,
Locale
the locale to use, not null
locale
)

Overrides default java.time.chrono.Era.getDisplayName.

Gets the textual representation of this era.

public int

Returns:

the era value, from 0 (BEFORE_BE) to 1 (BE)
getValue
()

Implements java.time.chrono.Era.getValue.

Gets the numeric era int value.

public static ThaiBuddhistEra

Returns:

the BuddhistEra singleton, never null
of
(int
the era to represent, from 0 to 1
thaiBuddhistEra
)

Obtains an instance of ThaiBuddhistEra from an int value.

public static ThaiBuddhistEra
public static ThaiBuddhistEra[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BEback to summary
public static final ThaiBuddhistEra BE

The singleton instance for the current era, 'Buddhist Era', which has the numeric value 1.

BEFORE_BEback to summary
public static final ThaiBuddhistEra BEFORE_BE

The singleton instance for the era before the current one, 'Before Buddhist Era', which has the numeric value 0.

Constructor Detail

ThaiBuddhistEraback to summary
private ThaiBuddhistEra()

Method Detail

getDisplayNameback to summary
public String getDisplayName(TextStyle style, Locale locale)

Overrides default java.time.chrono.Era.getDisplayName.

Doc from java.time.chrono.Era.getDisplayName.

Gets the textual representation of this era.

This returns the textual name used to identify the era, suitable for presentation to the user. The parameters control the style of the returned text and the locale.

If no textual mapping is found then the numeric value is returned.

Parameters
style:TextStyle

the style of the text required, not null

locale:Locale

the locale to use, not null

Returns:String

the text value of the era, not null

Annotations
@Override
getValueback to summary
public int getValue()

Implements java.time.chrono.Era.getValue.

Gets the numeric era int value.

The era BEFORE_BE has the value 0, while the era BE has the value 1.

Returns:int

the era value, from 0 (BEFORE_BE) to 1 (BE)

Annotations
@Override
ofback to summary
public static ThaiBuddhistEra of(int thaiBuddhistEra)

Obtains an instance of ThaiBuddhistEra from an int value.

ThaiBuddhistEra is an enum representing the Thai Buddhist eras of BEFORE_BE/BE. This factory allows the enum to be obtained from the int value.

Parameters
thaiBuddhistEra:int

the era to represent, from 0 to 1

Returns:ThaiBuddhistEra

the BuddhistEra singleton, never null

Exceptions
DateTimeException:
if the era is invalid
valueOfback to summary
public static ThaiBuddhistEra valueOf(String name)
valuesback to summary
public static ThaiBuddhistEra[] values()