Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Enums](https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra#enumconstants) \| [Methods](https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra#inhmethods)

# ThaiBuddhistEra


`
public

final

enum
ThaiBuddhistEra
`


`


`

`

extends https://developer.android.com/reference/java/lang/Enum<https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra>


`

`


implements

https://developer.android.com/reference/java/time/chrono/Era


`

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [java.lang.Enum](https://developer.android.com/reference/java/lang/Enum)\<[java.time.chrono.ThaiBuddhistEra](https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra)\> ||
|   | ↳ | java.time.chrono.ThaiBuddhistEra |

<br />

*** ** * ** ***

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.

| year-of-era | era | proleptic-year | ISO proleptic-year |
|---|---|---|---|
| 2 | BE | 2 | -542 |
| 1 | BE | 1 | -543 |
| 1 | BEFORE_BE | 0 | -544 |
| 2 | BEFORE_BE | -1 | -545 |
[Buddhist years and eras]


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

## Summary

| ### Enum values ||
|---|---|
| `https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra` | `BE` The singleton instance for the current era, 'Buddhist Era', which has the numeric value 1. |
| `https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra` | `BEFORE_BE` The singleton instance for the era before the current one, 'Before Buddhist Era', which has the numeric value 0. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra#getDisplayName(java.time.format.TextStyle,%20java.util.Locale)(https://developer.android.com/reference/java/time/format/TextStyle style, https://developer.android.com/reference/java/util/Locale locale) ` Gets the textual representation of this era. |
| ` int` | ` https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra#getValue()() ` Gets the numeric era `int` value. |
| ` static https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra` | ` https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra#of(int)(int thaiBuddhistEra) ` Obtains an instance of `ThaiBuddhistEra` from an `int` value. |
| ` static https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra` | ` https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra#valueOf(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` |
| ` static final https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra` | ` https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra#values()() ` |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Enum

` `


final

https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Enum#clone()()
`

Throws CloneNotSupportedException.


`


final

int` `
https://developer.android.com/reference/java/lang/Enum#compareTo(E)(https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra o)
`

Compares this enum with the specified object for order.


`


final

boolean` `
https://developer.android.com/reference/java/lang/Enum#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object other)
`

Returns true if the specified object is equal to this
enum constant.


`


final

void` `
https://developer.android.com/reference/java/lang/Enum#finalize()()
`

enum classes cannot have finalize methods.


`


final

https://developer.android.com/reference/java/lang/Class<https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra>` `
https://developer.android.com/reference/java/lang/Enum#getDeclaringClass()()
`

Returns the Class object corresponding to this enum constant's
enum type.


`


final

int` `
https://developer.android.com/reference/java/lang/Enum#hashCode()()
`

Returns a hash code for this enum constant.


`


final

https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Enum#name()()
`

Returns the name of this enum constant, exactly as declared in its
enum declaration.


`


final

int` `
https://developer.android.com/reference/java/lang/Enum#ordinal()()
`

Returns the ordinal of this enumeration constant (its position
in its enum declaration, where the initial constant is assigned
an ordinal of zero).


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Enum#toString()()
`

Returns the name of this enum constant, as contained in the
declaration.


`


static

<T extends https://developer.android.com/reference/java/lang/Enum<T>>
T` `
https://developer.android.com/reference/java/lang/Enum#valueOf(java.lang.Class<T>,%20java.lang.String)(https://developer.android.com/reference/java/lang/Class<T> enumClass, https://developer.android.com/reference/java/lang/String name)
`

Returns the enum constant of the specified enum class with the
specified name.


From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


From interface `

https://developer.android.com/reference/java/lang/Comparable

` `
abstract


int` `
https://developer.android.com/reference/java/lang/Comparable#compareTo(T)(https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra o)
`

Compares this object with the specified object for order.


From interface `

https://developer.android.com/reference/java/time/chrono/Era

` `

default


https://developer.android.com/reference/java/time/temporal/Temporal` `
https://developer.android.com/reference/java/time/chrono/Era#adjustInto(java.time.temporal.Temporal)(https://developer.android.com/reference/java/time/temporal/Temporal temporal)
`

Adjusts the specified temporal object to have the same era as this object.


`

default


int` `
https://developer.android.com/reference/java/time/chrono/Era#get(java.time.temporal.TemporalField)(https://developer.android.com/reference/java/time/temporal/TemporalField field)
`

Gets the value of the specified field from this era as an `int`.


`

default


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/time/chrono/Era#getDisplayName(java.time.format.TextStyle,%20java.util.Locale)(https://developer.android.com/reference/java/time/format/TextStyle style, https://developer.android.com/reference/java/util/Locale locale)
`

Gets the textual representation of this era.


`

default


long` `
https://developer.android.com/reference/java/time/chrono/Era#getLong(java.time.temporal.TemporalField)(https://developer.android.com/reference/java/time/temporal/TemporalField field)
`

Gets the value of the specified field from this era as a `long`.


`
abstract


int` `
https://developer.android.com/reference/java/time/chrono/Era#getValue()()
`

Gets the numeric value associated with the era as defined by the chronology.


`

default


boolean` `
https://developer.android.com/reference/java/time/chrono/Era#isSupported(java.time.temporal.TemporalField)(https://developer.android.com/reference/java/time/temporal/TemporalField field)
`

Checks if the specified field is supported.


`

default


<R>
R` `
https://developer.android.com/reference/java/time/chrono/Era#query(java.time.temporal.TemporalQuery<R>)(https://developer.android.com/reference/java/time/temporal/TemporalQuery<R> query)
`

Queries this era using the specified query.


`

default


https://developer.android.com/reference/java/time/temporal/ValueRange` `
https://developer.android.com/reference/java/time/chrono/Era#range(java.time.temporal.TemporalField)(https://developer.android.com/reference/java/time/temporal/TemporalField field)
`

Gets the range of valid values for the specified field.


From interface `

https://developer.android.com/reference/java/time/temporal/TemporalAccessor

` `

default


int` `
https://developer.android.com/reference/java/time/temporal/TemporalAccessor#get(java.time.temporal.TemporalField)(https://developer.android.com/reference/java/time/temporal/TemporalField field)
`

Gets the value of the specified field as an `int`.


`
abstract


long` `
https://developer.android.com/reference/java/time/temporal/TemporalAccessor#getLong(java.time.temporal.TemporalField)(https://developer.android.com/reference/java/time/temporal/TemporalField field)
`

Gets the value of the specified field as a `long`.


`
abstract


boolean` `
https://developer.android.com/reference/java/time/temporal/TemporalAccessor#isSupported(java.time.temporal.TemporalField)(https://developer.android.com/reference/java/time/temporal/TemporalField field)
`

Checks if the specified field is supported.


`

default


<R>
R` `
https://developer.android.com/reference/java/time/temporal/TemporalAccessor#query(java.time.temporal.TemporalQuery<R>)(https://developer.android.com/reference/java/time/temporal/TemporalQuery<R> query)
`

Queries this date-time.


`

default


https://developer.android.com/reference/java/time/temporal/ValueRange` `
https://developer.android.com/reference/java/time/temporal/TemporalAccessor#range(java.time.temporal.TemporalField)(https://developer.android.com/reference/java/time/temporal/TemporalField field)
`

Gets the range of valid values for the specified field.


From interface `

https://developer.android.com/reference/java/time/temporal/TemporalAdjuster

` `
abstract


https://developer.android.com/reference/java/time/temporal/Temporal` `
https://developer.android.com/reference/java/time/temporal/TemporalAdjuster#adjustInto(java.time.temporal.Temporal)(https://developer.android.com/reference/java/time/temporal/Temporal temporal)
`

Adjusts the specified temporal object.


## Enum values

### BE

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final ThaiBuddhistEra BE
```

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

<br />

### BEFORE_BE

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

## Public methods

### getDisplayName

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getDisplayName (TextStyle style, 
                Locale locale)
```

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 `https://developer.android.com/reference/java/time/chrono/Era#getValue()` is returned.

<br />

| Parameters ||
|---|---|
| `style` | `TextStyle`: <br /> |
| `locale` | `Locale`: <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the text value of the era, not null <br /> |

### getValue

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getValue ()
```

Gets the numeric era `int` value.


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

<br />

| Returns ||
|---|---|
| `int` | the era value, from 0 (BEFORE_BE) to 1 (BE) <br /> |

### of

Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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.

<br />

| Parameters ||
|---|---|
| `thaiBuddhistEra` | `int`: the era to represent, from 0 to 1 <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra` | the BuddhistEra singleton, never null <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/time/DateTimeException` | if the era is invalid |

### valueOf

```
public static ThaiBuddhistEra valueOf (String name)
```

<br />

<br />

| Parameters ||
|---|---|
| `name` | `String` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra` | <br /> |

### values

```
public static final ThaiBuddhistEra[] values ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra` | <br /> |