- 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 TypeMethodDescriptionbooleanchecks if interval contains instant timestamp - input value should be non-null - no null-check is performed by this functiondefault booleancontains(ZonedDateTime value) checks if interval contains ZonedDateTime timestamp - input value should be non-null - no null-check is performed by this functionend()get interval end timestampgetEnd()get interval end local date timegetStart()get interval start local date timedefault Intervalprevious()returns previous interval from current (only supported for fixed type intervals, such as day, month, year)start()get interval start timestamptimezone()returns interval timezone (default one is UTC)default Intervalreturns 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
checks if interval contains instant timestamp - input value should be non-null - no null-check is performed by this function- Returns:
- previous Interval
-
contains
checks if interval contains ZonedDateTime timestamp - input value should be non-null - no null-check is performed by this function- Returns:
- previous Interval
-
previous
returns previous interval from current (only supported for fixed type intervals, such as day, month, year)- Returns:
- previous Interval
-
withPrevious
returns extended interval including previous one (only supported for fixed type intervals, such as day, month, year)- Returns:
- previous Interval
-