Interface Interval

All Known Implementing Classes:
ws.slink.intervals.impl.CustomInterval, Day, Month, ws.slink.intervals.impl.OffsetAwareInterval, Year

public interface Interval
generic interval interface
Author:
Mikhail Kantur
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checks if interval contains instant timestamp - input value should be non-null - no null-check is performed by this function
    default boolean
    checks if interval contains ZonedDateTime timestamp - input value should be non-null - no null-check is performed by this function
    end()
    get interval end timestamp
    get interval end local date time
    get interval start local date time
    default Interval
    returns previous interval from current (only supported for fixed type intervals, such as day, month, year)
    get interval start timestamp
    returns interval timezone (default one is UTC)
    default Interval
    returns extended interval including previous one (only supported for fixed type intervals, such as day, month, year)
  • Method Details

    • timezone

      TimeZone timezone()
      returns interval timezone (default one is UTC)
      Returns:
      interval timezone
    • getStart

      LocalDateTime getStart()
      get interval start local date time
      Returns:
      interval start
    • getEnd

      LocalDateTime getEnd()
      get interval end local date time
      Returns:
      interval end
    • start

      Instant start()
      get interval start timestamp
      Returns:
      interval start
    • end

      Instant end()
      get interval end timestamp
      Returns:
      interval end
    • contains

      boolean contains(Instant value)
      checks if interval contains instant timestamp - input value should be non-null - no null-check is performed by this function
      Returns:
      previous Interval
    • contains

      default boolean contains(ZonedDateTime value)
      checks if interval contains ZonedDateTime timestamp - input value should be non-null - no null-check is performed by this function
      Returns:
      previous Interval
    • previous

      default Interval previous()
      returns previous interval from current (only supported for fixed type intervals, such as day, month, year)
      Returns:
      previous Interval
    • withPrevious

      default Interval withPrevious()
      returns extended interval including previous one (only supported for fixed type intervals, such as day, month, year)
      Returns:
      previous Interval