Class TemporalConverters


  • public class TemporalConverters
    extends Object
    Static repository of TemporalConverter instances which convert a temporal type from another temporal type e.g. given a LocalDate returns the hour, or given a Date returns a LocalDate. No-operation conversions e.g. LocalDate to LocalDate are present to keep a consistent usage pattern in the TemporalMatcher implementations.

    The temporal converters generally "down-cast" a temporal type to another and are used to support testing the actual type against the reference type where the reference type is an equal or less accurate temporal unit e.g. comparing if a LocalDateTime is on a given year. There should not be "up-casting" converters because these would be making up absent information e.g. converting a LocalDate to a LocalDateTime