Class DateRange

java.lang.Object
ch.poole.openinghoursparser.DateRange
All Implemented Interfaces:
Copy<ch.poole.openinghoursparser.Element>

public class DateRange extends Object
Container for objects from the opening_hours specification
  • Constructor Details

    • DateRange

      public DateRange()
      Default constructor
    • DateRange

      public DateRange(@NotNull @NotNull DateRange dr)
      Construct a new DateRange with the same content
      Parameters:
      dr - original DateRange
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toDebugString

      public String toDebugString()
      Create a string that identifies which class created it for debugging and testing
      Returns:
      the output of toString with the class name prepended
    • equals

      public boolean equals(Object other)
    • hashCode

      public int hashCode()
    • getStartDate

      @NotNull public @NotNull DateWithOffset getStartDate()
      Get the start date of the range
      Returns:
      the startDate
    • getEndDate

      @Nullable public @Nullable DateWithOffset getEndDate()
      Get the end date of the range
      Returns:
      the endDate, null if not present
    • getInterval

      public int getInterval()
      Get the interval for the date range Note: currently the opening hours specification is quiet on what units this is supposed to be in
      Returns:
      the interval, 0 if no interval
    • setStartDate

      public void setStartDate(@NotNull @NotNull DateWithOffset startDate)
      Set the start date of the range
      Parameters:
      startDate - the startDate to set, can not be null
    • setEndDate

      public void setEndDate(@Nullable @Nullable DateWithOffset endDate)
      Set the end date of the range
      Parameters:
      endDate - the end date of the range to set, null if there is no end date
    • setInterval

      public void setInterval(int interval)
      Set an interval for the date range Note: currently the opening hours specification is quiet on what units this is supposed to be in
      Parameters:
      interval - the interval to set
    • copy

      public DateRange copy()
      Description copied from interface: Copy
      Create a copy of the objecz
      Returns:
      a copy of the object