Package fr.marcwrobel.jbanking.calendar
Class ConfigurableCalendar
- java.lang.Object
-
- fr.marcwrobel.jbanking.calendar.ConfigurableCalendar
-
-
Field Summary
-
Fields inherited from interface fr.marcwrobel.jbanking.calendar.Calendar
MAX_ITERATIONS
-
-
Constructor Summary
Constructors Constructor Description ConfigurableCalendar(Holiday... holidays)Creates a new instance using the given bankHolidays.ConfigurableCalendar(Collection<Holiday> holidays)Creates a new instance using the given bankHolidays.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Holiday>getHolidaysFor(LocalDate date)Get all theHolidays matching with the given day.booleanisHoliday(LocalDate date)Check whether the given date is a public holiday.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface fr.marcwrobel.jbanking.calendar.Calendar
businessDaysWithin, holidaysWithin, isBusinessDay, next, nextOrSame, previous, previousOrSame, shift
-
-
-
-
Constructor Detail
-
ConfigurableCalendar
public ConfigurableCalendar(Collection<Holiday> holidays)
Creates a new instance using the given bankHolidays.- Parameters:
holidays- theHolidays that the calendar will be using.- Throws:
NullPointerException- ifholidaysis {code null} or if one of the holiday inholidaysis {code null}.
-
ConfigurableCalendar
public ConfigurableCalendar(Holiday... holidays)
Creates a new instance using the given bankHolidays.- Parameters:
holidays- theHolidays that the calendar will be using.- Throws:
NullPointerException- ifholidaysis {code null} or if one of the holiday inholidaysis {code null}.
-
-
Method Detail
-
isHoliday
public boolean isHoliday(LocalDate date)
Description copied from interface:CalendarCheck whether the given date is a public holiday.- Specified by:
isHolidayin interfaceCalendar- Parameters:
date- a non-null date.- Returns:
trueif the given date is a holiday,falseotherwise.- See Also:
Calendar.isHoliday(LocalDate)
-
getHolidaysFor
public Set<Holiday> getHolidaysFor(LocalDate date)
Description copied from interface:CalendarGet all theHolidays matching with the given day.- Specified by:
getHolidaysForin interfaceCalendar- Parameters:
date- a non-null and unmodifiable set ofHolidays.- Returns:
trueif the given date is a holiday,falseotherwise.- See Also:
Calendar.getHolidaysFor(LocalDate)
-
-