Enum DiscordianEra

  • All Implemented Interfaces:
    Serializable, Comparable<DiscordianEra>, Era, TemporalAccessor, TemporalAdjuster

    public enum DiscordianEra
    extends Enum<DiscordianEra>
    implements Era
    An era in the Discordian calendar system.

    The Discordian calendar system has one era. The current era, for years from 1 onwards, is known as the 'Year of Our Lady of Discord'. No other eras are supported.

    The start of the Discordian epoch 0001-01-01 (Discordian) is -1165-01-01 (ISO).

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

    Implementation Requirements:

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

      • YOLD

        public static final DiscordianEra YOLD
        The singleton instance for the current era, 'Year of Our Lady of Discord', which has the numeric value 1.
    • Method Detail

      • values

        public static DiscordianEra[] 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 (DiscordianEra c : DiscordianEra.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DiscordianEra valueOf​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • of

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

        DiscordianEra is an enum representing the Discordian era of YOLD. This factory allows the enum to be obtained from the int value. Only the value 1 is ever accepted.

        Parameters:
        era - the YOLD value to represent, which must be 1 (YOLD)
        Returns:
        the era singleton, not null
        Throws:
        DateTimeException - if the value is invalid
      • getValue

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

        The era YOLD has the value 1.

        Specified by:
        getValue in interface Era
        Returns:
        the era value, 1 for YOLD