Interface BusinessDayConvention
-
- All Superinterfaces:
Named
public interface BusinessDayConvention extends Named
A convention defining how to adjust a date if it falls on a day other than a business day.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.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
of
static BusinessDayConvention of(String uniqueName)
Obtains an instance from the specified unique name.- Parameters:
uniqueName
- the unique name- Returns:
- the business convention
- Throws:
IllegalArgumentException
- if the name is not known
-
extendedEnum
static ExtendedEnum<BusinessDayConvention> extendedEnum()
Gets the extended enum helper.This helper allows instances of the convention to be looked up. It also provides the complete set of available instances.
- Returns:
- the extended enum helper
-
adjust
LocalDate adjust(LocalDate date, HolidayCalendar calendar)
Adjusts the date as necessary if it is not a business day.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.
- Parameters:
date
- the date to adjustcalendar
- the calendar that defines holidays and business days- Returns:
- the adjusted date
-
getName
String getName()
Gets the name that uniquely identifies this convention.This name is used in serialization and can be parsed using
of(String)
.
-
-