Enum Class Time.Unit

java.lang.Object
java.lang.Enum<Time.Unit>
com.marcpg.libpg.data.time.Time.Unit
All Implemented Interfaces:
Serializable, Comparable<Time.Unit>, Constable
Enclosing class:
Time

public static enum Time.Unit extends Enum<Time.Unit>
A time unit, such as seconds, minutes, hours, etc.
Since:
0.0.1
  • Enum Constant Details

    • SECONDS

      public static final Time.Unit SECONDS
      One second - 1000 milliseconds
    • MINUTES

      public static final Time.Unit MINUTES
      One minute - 60 seconds
    • HOURS

      public static final Time.Unit HOURS
      One hour - 60 minutes / 3600 seconds
    • DAYS

      public static final Time.Unit DAYS
      One day - 24 hours
    • WEEKS

      public static final Time.Unit WEEKS
      One week - 7 days
    • MONTHS

      public static final Time.Unit MONTHS
      One month - ~4.34 weeks
    • YEARS

      public static final Time.Unit YEARS
      One year - 12 months / 365.25 days
    • DECADES

      public static final Time.Unit DECADES
      One decade - 10 years
    • CENTURIES

      public static final Time.Unit CENTURIES
      One century - 100 years / 10 decades
  • Field Details

  • Method Details

    • values

      public static Time.Unit[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Time.Unit valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • eng

      @NotNull public @NotNull String eng()
      Get pluralEng() but as singular.
      The full english name of the unit as listed in the english dictionary.
      Returns:
      The english name.
    • pluralEng

      @NotNull public @NotNull String pluralEng()
      Get eng() but as plural.
      Most times just with an s, but changes for century = centuries
      Returns:
      Plural form of eng()
      Since:
      0.0.1
    • toString

      @NotNull public @NotNull String toString()
      Just the same as eng().
      Overrides:
      toString in class Enum<Time.Unit>
      Since:
      0.0.1