Interface Offset<V>

Type Parameters:
V - the value to which the offset can be applied
All Superinterfaces:
Function<V,V>, UnaryOperator<V>
All Known Implementing Classes:
Offset.DefaultOffset, Offset.DurationOffset, Offset.InstantOffset, Offset.TemporalOffset

public interface Offset<V> extends UnaryOperator<V>
Encapsulates an offset that can be applied to a value.
Author:
Paul Ferraro
  • Method Details

    • isZero

      boolean isZero()
      Returns true if this offset is zero, false otherwise.
      Returns:
      true if this offset is zero, false otherwise.
    • forDuration

      static Offset<Duration> forDuration(Duration offset)
      Creates a duration-based offset for the specified duration.
      Parameters:
      offset - the offset duration
      Returns:
      a duration-based offset for the specified duration.
    • forInstant

      static Offset<Instant> forInstant(Duration offset)
      Creates an instant-based offset for the specified duration.
      Parameters:
      offset - the offset duration
      Returns:
      an instant-based offset for the specified duration.