Class FixedHoliday

  • All Implemented Interfaces:
    Holiday

    public final class FixedHoliday
    extends Object
    implements Holiday
    A Holiday occurring at given dates.

    This class is useful for modeling exceptional holidays like the golden jubilee in the United Kingdom.

    Since:
    2.1.0
    Author:
    Marc Wrobel
    • Constructor Detail

      • FixedHoliday

        public FixedHoliday​(LocalDate... dates)
        Create a new holiday using the given dates.
        Parameters:
        dates - a collection of LocalDates
        Throws:
        NullPointerException - if the given collection is null
    • Method Detail

      • check

        public boolean check​(LocalDate date)
        Description copied from interface: Holiday
        Check whether the given date is an occurrence of this holiday.
        Specified by:
        check in interface Holiday
        Parameters:
        date - the date to check.
        Returns:
        true if the given date is an occurrence of this holiday, false otherwise.
        See Also:
        Holiday.check(LocalDate)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object