public interface BusinessDayConvention extends Named
The purpose of this convention is to define how to handle non-business days. When processing dates in finance, it is typically intended that non-business days, such as weekends and holidays, are converted to a nearby valid business day. The convention, in conjunction with a holiday calendar, defines exactly how the adjustment should be made.
The most common implementations are provided in BusinessDayConventions.
Additional implementations may be added by implementing this interface.
All implementations of this interface must be immutable and thread-safe.
| Modifier and Type | Method and Description |
|---|---|
LocalDate |
adjust(LocalDate date,
HolidayCalendar calendar)
Adjusts the date as necessary if it is not a business day.
|
static ExtendedEnum<BusinessDayConvention> |
extendedEnum()
Gets the extended enum helper.
|
String |
getName()
Gets the name that uniquely identifies this convention.
|
static BusinessDayConvention |
of(String uniqueName)
Obtains an instance from the specified unique name.
|
static BusinessDayConvention of(String uniqueName)
uniqueName - the unique nameIllegalArgumentException - if the name is not knownstatic ExtendedEnum<BusinessDayConvention> extendedEnum()
This helper allows instances of the convention to be looked up. It also provides the complete set of available instances.
LocalDate adjust(LocalDate date, HolidayCalendar calendar)
If the date is a business day it will be returned unaltered. If the date is not a business day, the convention will be applied.
date - the date to adjustcalendar - the calendar that defines holidays and business daysString getName()
This name is used in serialization and can be parsed using of(String).
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.