Class TimeInterval


  • public final class TimeInterval
    extends Object
    A convenience class for storing a pair of instants that define a time interval.
    • Constructor Detail

      • TimeInterval

        public TimeInterval​(Instant startTime,
                            Instant endTime)
        Constructs a new time interval.
        Parameters:
        startTime - the start time of the interval
        endTime - the end time of the interval
    • Method Detail

      • getStartTime

        public Instant getStartTime()
        Returns the start time of the interval.
        Returns:
        the start time
      • getEndTime

        public Instant getEndTime()
        Returns the end time of the interval.
        Returns:
        the end time
      • getDuration

        public Duration getDuration()
        Returns the duration of the interval.
        Returns:
        the duration
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object