Package ch.poole.openinghoursparser
Class DateRange
- java.lang.Object
-
- ch.poole.openinghoursparser.DateRange
-
- All Implemented Interfaces:
Copy<ch.poole.openinghoursparser.Element>
public class DateRange extends java.lang.ObjectContainer for objects from the opening_hours specification
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DateRangecopy()Create a copy of the objeczbooleanequals(java.lang.Object other)@Nullable DateWithOffsetgetEndDate()Get the end date of the rangeintgetInterval()Get the interval for the date range Note: currently the opening hours specification is quiet on what units this is supposed to be in@NotNull DateWithOffsetgetStartDate()Get 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 rangejava.lang.StringtoDebugString()Create a string that identifies which class created it for debugging and testingjava.lang.StringtoString()
-
-
-
Constructor Detail
-
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 Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toDebugString
public java.lang.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(java.lang.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
-
-