Package fr.marcwrobel.jbanking.calendar
Class YearRangeHoliday
java.lang.Object
fr.marcwrobel.jbanking.calendar.YearRangeHoliday
- All Implemented Interfaces:
Holiday
A
Holiday that is valid only for a given range or years.
This class is useful for modeling holidays like the German reformation day that was exceptionally a national holiday in 2017 because of 500 anniversary of the religious reformation in Europe.
- Since:
- 2.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionYearRangeHoliday(Holiday base, long from, long to) Create a new holiday using the given base and years of validity.YearRangeHoliday(Holiday base, ValueRange validityRange) Create a new holiday using the given base and years of validity. -
Method Summary
-
Constructor Details
-
YearRangeHoliday
Create a new holiday using the given base and years of validity.- Parameters:
base- a non-null holiday to use as a base.validityRange- a non-null validity range.- Throws:
NullPointerException- if eitherbaseorvalidityRangeisnull
-
YearRangeHoliday
Create a new holiday using the given base and years of validity.- Parameters:
base- a non-null holiday to use as a base.from- the minimum year of validity (included)to- the maximum year of validity (included)- Throws:
NullPointerException- ifbaseisnullIllegalArgumentException- iffromis greater thanto
-
-
Method Details
-
check
Description copied from interface:HolidayCheck whether the given date is an occurrence of this holiday. -
equals
-
hashCode
public int hashCode() -
toString
-