Package ch.poole.openinghoursparser
Class Holiday
- java.lang.Object
-
- ch.poole.openinghoursparser.Holiday
-
- All Implemented Interfaces:
Copy<ch.poole.openinghoursparser.Element>
public class Holiday extends java.lang.ObjectContainer for objects from the opening_hours specification
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHoliday.Type
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Holidaycopy()Create a copy of the objeczbooleanequals(java.lang.Object other)booleangetAfterWeekDays()Check if the holiday was originally after the week daysintgetOffset()Holiday.TypegetType()booleangetUseAsWeekDay()Get the the "use as weekday" valueinthashCode()voidsetAfterWeekDays(boolean afterWeekDays)Set the flag that the holidays should be shown after the weekdays This is necessary due to a specification changevoidsetOffset(int offset)voidsetType(Holiday.Type type)voidsetUseAsWeekDay(boolean useAsWeekDay)Set how this holiday should be usedjava.lang.StringtoDebugString()Create a string that identifies which class created it for debugging and testingjava.lang.StringtoString()
-
-
-
Constructor Detail
-
Holiday
public Holiday()
Default constructor
-
Holiday
public Holiday(@NotNull @NotNull Holiday h)Construct a new Holiday with the same content- Parameters:
h- original Holiday
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
-
hashCode
public int hashCode()
-
getType
public Holiday.Type getType()
- Returns:
- the type
-
getOffset
public int getOffset()
- Returns:
- the offset
-
setType
public void setType(Holiday.Type type)
- Parameters:
type- the type to set
-
setOffset
public void setOffset(int offset)
- Parameters:
offset- the offset to set
-
setUseAsWeekDay
public void setUseAsWeekDay(boolean useAsWeekDay)
Set how this holiday should be used- Parameters:
useAsWeekDay- if true the holiday is a weekday equivalent
-
getUseAsWeekDay
public boolean getUseAsWeekDay()
Get the the "use as weekday" value- Returns:
- true if this should be used as a weekday equivalent
-
setAfterWeekDays
public void setAfterWeekDays(boolean afterWeekDays)
Set the flag that the holidays should be shown after the weekdays This is necessary due to a specification change- Parameters:
afterWeekDays- the value to set
-
getAfterWeekDays
public boolean getAfterWeekDays()
Check if the holiday was originally after the week days- Returns:
- true if the holiday was after the week days
-
copy
public Holiday copy()
Description copied from interface:CopyCreate a copy of the objecz- Returns:
- a copy of the 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
-
-