Interface Period

All Known Implementing Classes:
PatternPeriod

public interface Period
The period of a periodic segment (04-segment.md ยง3): presets YEAR, YEAR_MONTH and YEAR_MONTH_DAY, or your own.
  • Field Details

    • YEAR

      static final Period YEAR
      "2026".
    • YEAR_MONTH

      static final Period YEAR_MONTH
      "202610".
    • YEAR_MONTH_DAY

      static final Period YEAR_MONTH_DAY
      "20261026".
  • Method Details

    • keyOf

      String keyOf(Instant instant, ZoneId zone)
      The key of the period instant falls in.
      Parameters:
      instant - the instant
      zone - the time zone the periods follow
      Returns:
      the period key, such as "20261026"
    • endOf

      Instant endOf(String key, ZoneId zone)
      The end of the period, exclusive.
      Parameters:
      key - the period key
      zone - the time zone the periods follow
      Returns:
      the first instant after the period