Enum Class PatternPeriod

java.lang.Object
java.lang.Enum<PatternPeriod>
me.ahoo.cosid.internal.PatternPeriod
All Implemented Interfaces:
Serializable, Comparable<PatternPeriod>, Constable, Period

public enum PatternPeriod extends Enum<PatternPeriod> implements Period
The preset periods: calendar years, months and days in a time zone, keyed by their pattern().
  • Enum Constant Details

  • Method Details

    • values

      public static PatternPeriod[] 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 PatternPeriod 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
    • pattern

      public String pattern()
    • keyOf

      public String keyOf(Instant instant, ZoneId zone)
      Description copied from interface: Period
      The key of the period instant falls in.
      Specified by:
      keyOf in interface Period
      Parameters:
      instant - the instant
      zone - the time zone the periods follow
      Returns:
      the period key, such as "20261026"
    • endOf

      public Instant endOf(String key, ZoneId zone)
      Description copied from interface: Period
      The end of the period, exclusive.
      Specified by:
      endOf in interface Period
      Parameters:
      key - the period key
      zone - the time zone the periods follow
      Returns:
      the first instant after the period