Class RelativeHoliday

java.lang.Object
fr.marcwrobel.jbanking.calendar.RelativeHoliday
All Implemented Interfaces:
Holiday

public final class RelativeHoliday extends Object implements Holiday
A Holiday relative to another Holiday with a fixed day shift.

This class is modeling holidays like easter monday or good friday.

Since:
2.1.0
  • Constructor Details

    • RelativeHoliday

      public RelativeHoliday(Holiday base, int plusDays)
      Create a new holiday using the given base holiday and the given number of days as the shift.
      Parameters:
      base - a non-null holiday to use as a base.
      plusDays - a number of days to use as the shift (can be negative)
      Throws:
      NullPointerException - if the given base is null
  • Method Details

    • 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:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object