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

# HijrahEra

` public final enum HijrahEra `   
` ` ` extends https://developer.android.com/reference/java/lang/Enum<https://developer.android.com/reference/java/time/chrono/HijrahEra> ` ` 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.HijrahEra](https://developer.android.com/reference/java/time/chrono/HijrahEra)\> ||
|   | ↳ | java.time.chrono.HijrahEra |

<br />

*** ** * ** ***

An era in the Hijrah calendar system.

The Hijrah calendar system has only one era covering the proleptic years greater than zero.

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

## Summary

| ### Enum values ||
|---|---|
| `https://developer.android.com/reference/java/time/chrono/HijrahEra` | `AH` The singleton instance for the current era, 'Anno Hegirae', which has the numeric value 1. |

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

### AH

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

```
public static final HijrahEra AH
```

The singleton instance for the current era, 'Anno Hegirae', 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 AH has the value 1.

<br />

| Returns ||
|---|---|
| `int` | the era value, 1 (AH) <br /> |

### of

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

```
public static HijrahEra of (int hijrahEra)
```

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

The current era, which is the only accepted value, has the value 1

<br />

| Parameters ||
|---|---|
| `hijrahEra` | `int`: the era to represent, only 1 supported <br /> |

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

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

### range

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

```
public ValueRange range (TemporalField field)
```

Gets the range of valid values for the specified field.

The range object expresses the minimum and maximum valid values for a field. This era is used to enhance the accuracy of the returned range. If it is not possible to return the range, because the field is not supported or for some other reason, an exception is thrown.

If the field is a `https://developer.android.com/reference/java/time/temporal/ChronoField` then the query is implemented here. The `ERA` field returns the range. All other `ChronoField` instances will throw an `UnsupportedTemporalTypeException`.

If the field is not a `ChronoField`, then the result of this method is obtained by invoking `TemporalField.rangeRefinedBy(TemporalAccessor)` passing `this` as the argument. Whether the range can be obtained is determined by the field.

The `ERA` field returns a range for the one valid Hijrah era.

<br />

| Parameters ||
|---|---|
| `field` | `TemporalField`: the field to query the range for, not null <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/time/temporal/ValueRange` | the range of valid values for the field, not null <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/time/DateTimeException` | if the range for the field cannot be obtained |
| `https://developer.android.com/reference/java/time/temporal/UnsupportedTemporalTypeException` | if the unit is not supported |

### valueOf

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

<br />

<br />

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

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

### values

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

<br />

<br />

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