Class TimeWindow


  • public class TimeWindow
    extends java.lang.Object
    This class represents a window of time for selected hours on selected days.
    Author:
    mpolden
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.time.DayOfWeek> days()
      Returns days in this time window
      static TimeWindow from​(java.lang.String daySpec, java.lang.String hourSpec, java.lang.String zoneSpec)
      Parse a time window from the given day, hour and time zone specification
      java.util.List<java.lang.Integer> hours()
      Returns hours in this time window
      boolean includes​(java.time.Instant instant)
      Returns whether the given instant is in this time window
      java.lang.String toString()  
      java.time.ZoneId zone()
      Returns the time zone of this time window
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • days

        public java.util.List<java.time.DayOfWeek> days()
        Returns days in this time window
      • hours

        public java.util.List<java.lang.Integer> hours()
        Returns hours in this time window
      • zone

        public java.time.ZoneId zone()
        Returns the time zone of this time window
      • includes

        public boolean includes​(java.time.Instant instant)
        Returns whether the given instant is in this time window
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • from

        public static TimeWindow from​(java.lang.String daySpec,
                                      java.lang.String hourSpec,
                                      java.lang.String zoneSpec)
        Parse a time window from the given day, hour and time zone specification