Class Holiday

  • All Implemented Interfaces:
    Copy<ch.poole.openinghoursparser.Element>

    public class Holiday
    extends java.lang.Object
    Container for objects from the opening_hours specification
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Holiday.Type  
    • Constructor Summary

      Constructors 
      Constructor Description
      Holiday()
      Default constructor
      Holiday​(@NotNull Holiday h)
      Construct a new Holiday with the same content
    • 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:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
      • hashCode

        public int hashCode()
      • 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 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