Package ch.poole.openinghoursparser
Class DateRange
java.lang.Object
ch.poole.openinghoursparser.DateRange
- All Implemented Interfaces:
Copy<ch.poole.openinghoursparser.Element>
Container for objects from the opening_hours specification
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Create a copy of the objeczboolean@Nullable DateWithOffsetGet the end date of the rangeintGet the interval for the date range Note: currently the opening hours specification is quiet on what units this is supposed to be in@NotNull DateWithOffsetGet the start date of the rangeinthashCode()voidsetEndDate(@Nullable DateWithOffset endDate) Set the end date of the rangevoidsetInterval(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 invoidsetStartDate(@NotNull DateWithOffset startDate) Set the start date of the rangeCreate a string that identifies which class created it for debugging and testingtoString()
-
Constructor Details
-
DateRange
public DateRange()Default constructor -
DateRange
Construct a new DateRange with the same content- Parameters:
dr- original DateRange
-
-
Method Details
-
toString
-
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
-
hashCode
public int hashCode() -
getStartDate
Get the start date of the range- Returns:
- the startDate
-
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
Set the start date of the range- Parameters:
startDate- the startDate to set, can not be null
-
setEndDate
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
Description copied from interface:CopyCreate a copy of the objecz- Returns:
- a copy of the object
-