Interface Calendrical

All Known Implementing Classes:
AmPmOfDay, CalendricalMerger, Chronology, CopticChronology, CopticDate, DateTimeFields, DayOfWeek, HistoricChronology, HistoricDate, HistoricEra, ISOChronology, JulianChronology, LocalDate, LocalDateTime, LocalTime, MonthDay, MonthOfYear, OffsetDate, OffsetDateTime, OffsetTime, QuarterOfYear, TimeZone, TimeZone.Fixed, TimeZone.ID, Year, YearMonth, ZonedDateTime, ZoneOffset

public interface Calendrical
Provides access in a uniform way to calendrical values.

All classes that can provide calendrical information should implement this interface. The single method allows a calendrical to be queried to find the value of a rule. A calendrical might be a single field, such as month-of-year or hour-of-day, or a whole object, such as LocalDate or ZoneOffset.

Calendrical makes no guarantees about the thread-safety or immutability of implementations.

  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    Gets the value of the specified calendrical rule.
  • Method Details

    • get

      <T> T get(CalendricalRule<T> rule)
      Gets the value of the specified calendrical rule.

      This method queries the value of the specified rule. If the rule is not supported then null will be returned.

      Where this method returns numeric values, Integer is the preferred type. The values should be within the range of the field wherever possible. For example, minute-of-hour should be from 0 to 59 inclusive. The calling code must validate the value however and not trust it to be valid.

      Parameters:
      rule - the rule to query, not null
      Returns:
      the value for the rule, null if no value for the rule