Enum EthiopicEra

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<EthiopicEra>, java.time.chrono.Era, java.time.temporal.TemporalAccessor, java.time.temporal.TemporalAdjuster

    public enum EthiopicEra
    extends java.lang.Enum<EthiopicEra>
    implements java.time.chrono.Era
    An era in the Ethiopic calendar system.

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

    The start of the Ethiopic epoch 0001-01-01 (Ethiopic) is 0284-08-29 (ISO).

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

    Implementation Requirements:

    This is an immutable and thread-safe enum.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BEFORE_INCARNATION
      The singleton instance for the era before the current one, 'Before Incarnation Era', which has the numeric value 0.
      INCARNATION
      The singleton instance for the current era, 'Incarnation Era', which has the numeric value 1.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getValue()
      Gets the numeric era int value.
      static EthiopicEra of​(int era)
      Obtains an instance of EthiopicEra from an int value.
      static EthiopicEra valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static EthiopicEra[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.time.chrono.Era

        adjustInto, get, getDisplayName, getLong, isSupported, query, range
    • Enum Constant Detail

      • BEFORE_INCARNATION

        public static final EthiopicEra BEFORE_INCARNATION
        The singleton instance for the era before the current one, 'Before Incarnation Era', which has the numeric value 0.
      • INCARNATION

        public static final EthiopicEra INCARNATION
        The singleton instance for the current era, 'Incarnation Era', which has the numeric value 1.
    • Method Detail

      • values

        public static EthiopicEra[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (EthiopicEra c : EthiopicEra.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static EthiopicEra valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • of

        public static EthiopicEra of​(int era)
        Obtains an instance of EthiopicEra from an int value.

        EthiopicEra is an enum representing the Ethiopic eras of BEFORE_INCARNATION/INCARNATION. This factory allows the enum to be obtained from the int value.

        Parameters:
        era - the BEFORE_INCARNATION/INCARNATION value to represent, from 0 (BEFORE_INCARNATION) to 1 (INCARNATION)
        Returns:
        the era singleton, not null
        Throws:
        java.time.DateTimeException - if the value is invalid
      • getValue

        public int getValue()
        Gets the numeric era int value.

        The era BEFORE_INCARNATION has the value 0, while the era INCARNATION has the value 1.

        Specified by:
        getValue in interface java.time.chrono.Era
        Returns:
        the era value, from 0 (BEFORE_INCARNATION) to 1 (INCARNATION)