Package org.holiday.calendar.function


package org.holiday.calendar.function
Functional interfaces to support construction of filters and date calculation algorithms as lambda expressions.

Observance computes the date of a FloatingHoliday or EarlyCloseHoliday for a given year and also acts as a Predicate<Integer> indicating whether the holiday occurs in that year (e.g. a holiday introduced only from a certain year onward):


 Observance juneteenth = year -> year >= 2021 ? LocalDate.of(year, Month.JUNE, 19) : null;
 

DateRoll adjusts a calculated date that falls on a weekend to its actual observed date; DateRolls supplies common strategies used throughout the regional calendar modules:


 HolidayCalendar.builder()
     .dateRoll(DateRolls.followingMonday())
     .weekendDays(HolidayCalendar.STANDARD_WEEKEND)
     // ...
     .build();
 
Author:
Dave Joyce
  • Class
    Description
    Defines date adjustment behavior for holiday observance when the calculated date falls on a weekend day.
    Factory providing common DateRoll strategies.
    Function for computation of observed date of a holiday for a specified year.