Class Holiday

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

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

    • 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 Details

    • toString

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

      public boolean equals(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: Copy
      Create a copy of the objecz
      Returns:
      a copy of the 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