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/MinguoEra#enumconstants) \| [Methods](https://developer.android.com/reference/java/time/chrono/MinguoEra#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/java/time/chrono/MinguoEra#inhmethods)

# MinguoEra


`
public

final

enum
MinguoEra
`


`


`

`

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


`

`


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.MinguoEra](https://developer.android.com/reference/java/time/chrono/MinguoEra)\> ||
|   | ↳ | java.time.chrono.MinguoEra |

<br />

*** ** * ** ***

An era in the Minguo calendar system.


The Minguo calendar system has two eras.
The current era, for years from 1 onwards, is known as the 'Republic of China' 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 Republic of China' era.

| year-of-era | era | proleptic-year | ISO proleptic-year |
|---|---|---|---|
| 2 | ROC | 2 | 1913 |
| 1 | ROC | 1 | 1912 |
| 1 | BEFORE_ROC | 0 | 1911 |
| 2 | BEFORE_ROC | -1 | 1910 |
[Minguo years and eras]


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

## Summary

| ### Enum values ||
|---|---|
| `https://developer.android.com/reference/java/time/chrono/MinguoEra` | `BEFORE_ROC` The singleton instance for the era before the current one, 'Before Republic of China Era', which has the numeric value 0. |
| `https://developer.android.com/reference/java/time/chrono/MinguoEra` | `ROC` The singleton instance for the current era, 'Republic of China Era', which has the numeric value 1. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/time/chrono/MinguoEra#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/MinguoEra#getValue()() ` Gets the numeric era `int` value. |
| ` static https://developer.android.com/reference/java/time/chrono/MinguoEra` | ` https://developer.android.com/reference/java/time/chrono/MinguoEra#of(int)(int minguoEra) ` Obtains an instance of `MinguoEra` from an `int` value. |
| ` static https://developer.android.com/reference/java/time/chrono/MinguoEra` | ` https://developer.android.com/reference/java/time/chrono/MinguoEra#valueOf(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` |
| ` static final https://developer.android.com/reference/java/time/chrono/MinguoEra` | ` https://developer.android.com/reference/java/time/chrono/MinguoEra#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/MinguoEra 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/MinguoEra>` | ` 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/MinguoEra 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

### BEFORE_ROC

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

```
public static final MinguoEra BEFORE_ROC
```

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

<br />

### ROC

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

```
public static final MinguoEra ROC
```

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

<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_ROC has the value 0, while the era ROC has the value 1.

<br />

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

### of

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

```
public static MinguoEra of (int minguoEra)
```

Obtains an instance of `MinguoEra` from an `int` value.


`MinguoEra` is an enum representing the Minguo eras of BEFORE_ROC/ROC.
This factory allows the enum to be obtained from the `int` value.

<br />

| Parameters ||
|---|---|
| `minguoEra` | `int`: the BEFORE_ROC/ROC value to represent, from 0 (BEFORE_ROC) to 1 (ROC) <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/chrono/MinguoEra` | the era singleton, not null <br /> |

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

### valueOf

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

<br />

<br />

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

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

### values

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

<br />

<br />

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