Interface Temporal

All Superinterfaces:
TemporalAccessor
All Known Subinterfaces:
ChronoLocalDate, ChronoLocalDateTime<D>, ChronoZonedDateTime<D>
All Known Implementing Classes:
Instant, LocalDate, LocalDateTime, LocalTime, OffsetDateTime, ZonedDateTime

public interface Temporal extends TemporalAccessor
A date, a time or a moment that can be moved by an amount of time and measured against another of its kind.
  • Method Details

    • isSupported

      boolean isSupported(TemporalUnit unit)
      Whether this value can add or subtract unit.
    • plus

      Temporal plus(long amountToAdd, TemporalUnit unit)
      This value moved forward by amountToAdd of unit.
    • minus

      default Temporal minus(long amountToSubtract, TemporalUnit unit)
      This value moved back by amountToSubtract of unit.
    • plus

      default Temporal plus(TemporalAmount amount)
      This value moved forward by amount.
    • minus

      default Temporal minus(TemporalAmount amount)
      This value moved back by amount.
    • until

      long until(Temporal endExclusive, TemporalUnit unit)
      The whole units of unit from this value to endExclusive.