TemporalQueries.chronology

A query for the {@code Chronology}. !(p) This queries a {@code TemporalAccessor} for the chronology. If the target {@code TemporalAccessor} represents a date, or part of a date, then it should return the chronology that the date is expressed _in. As a result of this definition, objects only representing time, such as {@code LocalTime}, will return null. !(p) The result from JDK classes implementing {@code TemporalAccessor} is as follows:!(br) {@code LocalDate} returns {@code IsoChronology.INSTANCE}!(br) {@code LocalTime} returns null (does not represent a date)!(br) {@code LocalDateTime} returns {@code IsoChronology.INSTANCE}!(br) {@code ZonedDateTime} returns {@code IsoChronology.INSTANCE}!(br) {@code OffsetTime} returns null (does not represent a date)!(br) {@code OffsetDateTime} returns {@code IsoChronology.INSTANCE}!(br) {@code ChronoLocalDate} returns the associated chronology!(br) {@code ChronoLocalDateTime} returns the associated chronology!(br) {@code ChronoZonedDateTime} returns the associated chronology!(br) {@code Era} returns the associated chronology!(br) {@code DayOfWeek} returns null (shared across chronologies)!(br) {@code Month} returns {@code IsoChronology.INSTANCE}!(br) {@code Year} returns {@code IsoChronology.INSTANCE}!(br) {@code YearMonth} returns {@code IsoChronology.INSTANCE}!(br) {@code MonthDay} returns null {@code IsoChronology.INSTANCE}!(br) {@code ZoneOffset} returns null (does not represent a date)!(br) {@code Instant} returns null (does not represent a date)!(br) !(p) The method {@link hunt.time.chrono.Chronology#from(TemporalAccessor)} can be used as a {@code TemporalQuery} via a method reference, {@code Chronology::from}. That method is equivalent to this query, except that it throws an exception if a chronology cannot be obtained.

@return a query that can obtain the chronology of a temporal, not null

class TemporalQueries
static
chronology
()

Meta