Package fr.marcwrobel.jbanking.calendar
Class SuppressedHoliday
- java.lang.Object
-
- fr.marcwrobel.jbanking.calendar.SuppressedHoliday
-
- All Implemented Interfaces:
Holiday
public final class SuppressedHoliday extends Object implements Holiday
AHolidaythat has been punctually suppressed.This class is useful for modeling holidays like the Spring public holiday in the United Kingdom, that has been exceptionally suppressed in 2002 and 2012 for the golden and diamond jubilee.
- Since:
- 2.1.0
- Author:
- Marc Wrobel
-
-
Constructor Summary
Constructors Constructor Description SuppressedHoliday(Holiday base, Integer... suppressedYears)Create a new holiday using the given base and suppressed years.SuppressedHoliday(Holiday base, Collection<Integer> suppressedYears)Create a new holiday using the given base and suppressed years.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheck(LocalDate date)Check whether the given date is an occurrence of this holiday.booleanequals(Object o)inthashCode()StringtoString()
-
-
-
Constructor Detail
-
SuppressedHoliday
public SuppressedHoliday(Holiday base, Collection<Integer> suppressedYears)
Create a new holiday using the given base and suppressed years.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 base.suppressedYears- a list of year the holiday has been suppressed- Throws:
NullPointerException- ifbaseis null
-
SuppressedHoliday
public SuppressedHoliday(Holiday base, Integer... suppressedYears)
Create a new holiday using the given base and suppressed years.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 base.suppressedYears- a list of year the holiday has been suppressed- Throws:
NullPointerException- ifbaseis null
-
-
Method Detail
-
check
public boolean check(LocalDate date)
Description copied from interface:HolidayCheck whether the given date is an occurrence of this holiday.- Specified by:
checkin interfaceHoliday- Parameters:
date- the date to check.- Returns:
trueif the given date is an occurrence of this holiday,falseotherwise.- See Also:
Holiday.check(LocalDate)
-
-