- All Known Implementing Classes:
FixedHoliday,FloatingHoliday,SpecialAnniversary
An official day on which work does not occur. A holiday may be traditional,
religious, or governmental in origin. Its date of occurrence may be fixed,
moveable, or
otherwise computed.
Permitted subtypes determine the method of holiday date calculation.
- Author:
- Dave Joyce
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Holiday.HolidayBuilderbuilder()Get a new builder object for construction of a configuredHolidayinstance to be used with one or more holiday calendars.dateForYear(int year) Calculate the date of this holiday for the specified year.Get the description (if any) of this holiday.getName()Get the name of this holiday.booleanDetermine if this holiday supports date rolling for actual observance on a holiday calendar.
-
Method Details
-
builder
Get a new builder object for construction of a configuredHolidayinstance to be used with one or more holiday calendars.- Returns:
- new
Holidaybuilder instance
-
getName
String getName()Get the name of this holiday.- Returns:
- holiday name
-
getDescription
String getDescription()Get the description (if any) of this holiday.- Returns:
- holiday description
-
isRollable
boolean isRollable()Determine if this holiday supports date rolling for actual observance on a holiday calendar.- Returns:
trueif the date of occurrence for this holiday may be rolled for observance,falseotherwise
-
dateForYear
Calculate the date of this holiday for the specified year. The date returned by this method may be adjusted to a different date of observance by the associatedholiday calendar.- Parameters:
year- full calendar year (e.g. 1977, 2021)- Returns:
- date of this holiday, or
emptyif not observed on the specified year
-