Package fr.marcwrobel.jbanking.calendar
Class MovedHoliday
java.lang.Object
fr.marcwrobel.jbanking.calendar.MovedHoliday
- All Implemented Interfaces:
Holiday
A
Holiday that has been punctually moved to another day.
This class is useful for modeling holidays like the May Day in the United Kingdom, that has been exceptionally moved from 2020-05-04 to 2020-05-08 in 2020 to coincide with Victory in Europe Day.
- Since:
- 2.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionMovedHoliday(Holiday base, LocalDate... replacements) Create a new holiday using the given base and replacementsMap.MovedHoliday(MonthDay base, MonthDay replacement, int... replacedYears) Create a new holiday using the given baseMonthDayHoliday, the replacement dayMonthDayand the years when the replacement must occur. -
Method Summary
-
Constructor Details
-
MovedHoliday
Create a new holiday using the given base and replacementsMap.The replacements are expressed as
k1, v1, k2, v2, ..., kn, vnwhere kn are the original dates dans vn are the replacement.- Parameters:
base- a non-null holiday to use as a basereplacements- replacements, expressed as key / value- Throws:
NullPointerException- ifbaseisnull
-
MovedHoliday
Create a new holiday using the given baseMonthDayHoliday, the replacement dayMonthDayand the years when the replacement must occur.This constructor build a
MonthDayHolidayinternally.- Parameters:
base- a non-null holiday to use as a base.replacement- the replacement expressed as aMonthDayreplacedYears- the years when the holiday must be replaced- Throws:
NullPointerException- ifbaseisnull
-
-
Method Details
-
check
Description copied from interface:HolidayCheck whether the given date is an occurrence of this holiday. -
equals
-
hashCode
public int hashCode() -
toString
-