Class HolidayCalendars
- java.lang.Object
-
- com.opengamma.strata.basics.date.HolidayCalendars
-
public final class HolidayCalendars extends Object
Constants and implementations for standard holiday calendars.The purpose of each holiday calendar is to define whether a date is a holiday or a business day. The standard holiday calendar data is provided by direct research and is not derived from a vendor of holiday calendar data. The implementation is defined by
HolidayCalendar.ini
, The data may or may not be sufficient for your production needs.Applications should refer to holidays using
HolidayCalendarId
. The identifier must be resolved to aHolidayCalendar
before holidays can be accessed.
-
-
Field Summary
Fields Modifier and Type Field Description static HolidayCalendar
FRI_SAT
An instance declaring all days as business days except Friday/Saturday weekends.static HolidayCalendar
NO_HOLIDAYS
An instance declaring no holidays and no weekends.static HolidayCalendar
SAT_SUN
An instance declaring all days as business days except Saturday/Sunday weekends.static HolidayCalendar
THU_FRI
An instance declaring all days as business days except Thursday/Friday weekends.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ReferenceData
defaultingReferenceData(ReferenceData underlying)
Decorates aReferenceData
instance such that all requests for aHolidayCalendarId
will return a value.static ExtendedEnum<HolidayCalendar>
extendedEnum()
Gets the extended enum helper.static HolidayCalendar
of(String uniqueName)
Obtains an instance from the set of standard holiday calendars.
-
-
-
Field Detail
-
NO_HOLIDAYS
public static final HolidayCalendar NO_HOLIDAYS
An instance declaring no holidays and no weekends.This calendar has the effect of making every day a business day. It is often used to indicate that a holiday calendar does not apply.
-
SAT_SUN
public static final HolidayCalendar SAT_SUN
An instance declaring all days as business days except Saturday/Sunday weekends.This calendar is mostly useful in testing scenarios. Note that not all countries use Saturday and Sunday weekends.
-
FRI_SAT
public static final HolidayCalendar FRI_SAT
An instance declaring all days as business days except Friday/Saturday weekends.This calendar is mostly useful in testing scenarios.
-
THU_FRI
public static final HolidayCalendar THU_FRI
An instance declaring all days as business days except Thursday/Friday weekends.This calendar is mostly useful in testing scenarios.
-
-
Method Detail
-
defaultingReferenceData
public static ReferenceData defaultingReferenceData(ReferenceData underlying)
Decorates aReferenceData
instance such that all requests for aHolidayCalendarId
will return a value.If the
HolidayCalendarId
is not found in the underlying reference data, an instance with Saturday/Sunday holidays will be returned.- Parameters:
underlying
- the underlying instance- Returns:
- the holiday safe reference data
-
of
public static HolidayCalendar of(String uniqueName)
Obtains an instance from the set of standard holiday calendars.The unique name identifies the calendar in the standard source of calendars. The standard source is loaded at startup based on the
HolidayCalendar.ini
file.Applications should generally avoid using this method. Instead, applications should refer to holidays using
HolidayCalendarId
, resolving them using aReferenceData
.It is possible to combine two or more calendars using the '+' symbol. For example, 'GBLO+USNY' will combine the separate 'GBLO' and 'USNY' calendars.
- Parameters:
uniqueName
- the unique name of the calendar- Returns:
- the holiday calendar
-
extendedEnum
public static ExtendedEnum<HolidayCalendar> extendedEnum()
Gets the extended enum helper.This helper allows instances of the calendar to be looked up. It also provides the complete set of available instances.
- Returns:
- the extended enum helper
-
-