Module org.holiday.calendar.core
Package org.holiday.calendar
package org.holiday.calendar
Base classes and interfaces of the Holiday Calendar API.
Holiday is a sealed interface describing a
single holiday's identity and date-calculation method, with four permitted
subtypes: FixedHoliday (same MonthDay
every year), FloatingHoliday (date computed via
an Observance),
SpecialAnniversary (anniversary of a fixed
date), and EarlyCloseHoliday (a non-rollable
partial trading day, carrying a local close time and zone).
HolidayCalendar is a named, immutable
collection of holidays, plus a DateRoll
weekend-adjustment strategy, that calculates the observed
HolidayDates for a given year.
HolidayCalendarService is the extension
point implemented by each regional module and discovered at runtime by
HolidayCalendarFactory via
ServiceLoader:
HolidayCalendarFactory factory = new HolidayCalendarFactory();
HolidayCalendar calendar = factory.create("XNYS");
List<HolidayDate> fullClosures = calendar.calculate(2026);
if (calendar.hasEarlyCloses()) {
List<HolidayDate> earlyCloses = calendar.calculateEarlyCloses(2026);
}
- Author:
- Dave Joyce
-
ClassDescriptionAbstract base class for
HolidayCalendarServiceimplementations, providing the identity behavior common to all concrete service classes.A holiday which represents a partial trading day — a day on which a market or exchange closes early rather than closing for the entire day.A holiday which occurs on the same date every year.A holiday which occurs on a different date every year.An official day on which work does not occur.Builder for configurable construction ofHolidayobjects.Enumerated type ofHoliday.A named collection ofholidaysobserved within a single calendar year.Factory for creation ofHolidayCalendarobjects.Exception thrown when a requested holiday calendar code is not provided by any registeredHolidayCalendarService.Required behavior of a service which provides theHolidayCalendarobject assigned to a unique code identifier.The observed date of aHolidayin a particular year of the Common Era (CE).A holiday which commemorates a particular anniversary of an event.