Enum Class BrickChronoUnit

java.lang.Object
java.lang.Enum<BrickChronoUnit>
com.guflimc.brick.i18n.api.time.BrickChronoUnit
All Implemented Interfaces:
Serializable, Comparable<BrickChronoUnit>, Constable, TemporalUnit

public enum BrickChronoUnit extends Enum<BrickChronoUnit> implements TemporalUnit
  • Enum Constant Details

    • YEARS

      public static final BrickChronoUnit YEARS
      This unit replaces ChronoUnit.YEARS with a fixed length of 360 days. This is used when parsing a duration and during the formatting of a duration.
    • MONTHS

      public static final BrickChronoUnit MONTHS
      This unit replaces ChronoUnit.MONTHS with a fixed length of 30 days. This is used when parsing a duration and during the formatting of a duration.
  • Method Details

    • values

      public static BrickChronoUnit[] 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 BrickChronoUnit 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
    • getDuration

      public Duration getDuration()
      Specified by:
      getDuration in interface TemporalUnit
    • isDurationEstimated

      public boolean isDurationEstimated()
      Although the duration of these units is not accurate, e.g. due leap years, we do return false here because these units are meant to be used as if their durations were accurate.
      Specified by:
      isDurationEstimated in interface TemporalUnit
      Returns:
      false
    • isDateBased

      public boolean isDateBased()
      Specified by:
      isDateBased in interface TemporalUnit
    • isTimeBased

      public boolean isTimeBased()
      Specified by:
      isTimeBased in interface TemporalUnit
    • addTo

      public <R extends Temporal> R addTo(R temporal, long amount)
      Specified by:
      addTo in interface TemporalUnit
    • between

      public long between(Temporal temporal1Inclusive, Temporal temporal2Exclusive)
      Specified by:
      between in interface TemporalUnit