Interface TimeAdjuster

All Known Implementing Classes:
LocalDateTime, LocalTime, OffsetDateTime, OffsetTime

public interface TimeAdjuster
Strategy for adjusting a time.

This interface provides a common way to access many different time adjustments. These could be simple, such as simply setting the hour field, or complex, such as adjusting the time to the end of the working day.

TimeAdjuster is an interface and must be implemented with care to ensure other classes in the framework operate correctly. All instantiable implementations must be final, immutable and thread-safe.

  • Method Summary

    Modifier and Type
    Method
    Description
    Adjusts the input time returning the adjusted time.
  • Method Details

    • adjustTime

      LocalTime adjustTime(LocalTime time)
      Adjusts the input time returning the adjusted time.

      This is a strategy pattern that allows a range of adjustments to be made to a time.

      Parameters:
      time - the time to adjust, not null
      Returns:
      the adjusted time, never null