public final class AdjustableDates extends Object implements org.joda.beans.ImmutableBean, Serializable
This class combines a list of unadjusted dates with the single business day adjustment necessary to adjust them.
Calling the adjusted(ReferenceData) method will return the adjusted dates.
| Modifier and Type | Class and Description |
|---|---|
static class |
AdjustableDates.Meta
The meta-bean for
AdjustableDates. |
| Modifier and Type | Method and Description |
|---|---|
ImmutableList<LocalDate> |
adjusted(ReferenceData refData)
Adjusts the dates using the business day adjustment.
|
boolean |
equals(Object obj) |
BusinessDayAdjustment |
getAdjustment()
Gets the business day adjustment that is to be applied to the unadjusted dates.
|
ImmutableList<LocalDate> |
getUnadjusted()
Gets the unadjusted dates, in order.
|
int |
hashCode() |
static AdjustableDates.Meta |
meta()
The meta-bean for
AdjustableDates. |
AdjustableDates.Meta |
metaBean() |
static AdjustableDates |
of(BusinessDayAdjustment adjustment,
List<LocalDate> dates)
Obtains an instance with a business day adjustment.
|
static AdjustableDates |
of(BusinessDayAdjustment adjustment,
LocalDate firstDate,
LocalDate... remainingDates)
Obtains an instance with a business day adjustment.
|
static AdjustableDates |
of(List<LocalDate> dates)
Obtains an instance with no business day adjustment.
|
static AdjustableDates |
of(LocalDate firstDate,
LocalDate... remainingDates)
Obtains an instance with no business day adjustment.
|
ImmutableList<AdjustableDate> |
toAdjustableDateList()
Returns a list of
AdjustableDate equivalent to this instance. |
String |
toString()
Returns a string describing the adjustable dates.
|
public static AdjustableDates of(LocalDate firstDate, LocalDate... remainingDates)
This creates an instance from the specified dates.
No business day adjustment applies, thus the result of adjusted(ReferenceData)
is the specified dates.
firstDate - the first dateremainingDates - the remaining dates, in orderpublic static AdjustableDates of(List<LocalDate> dates)
This creates an instance from the specified dates.
No business day adjustment applies, thus the result of adjusted(ReferenceData)
is the specified dates.
dates - the dates, at least size 1, in orderpublic static AdjustableDates of(BusinessDayAdjustment adjustment, LocalDate firstDate, LocalDate... remainingDates)
This creates an instance from the unadjusted dates and business day adjustment.
The adjusted dates are accessible via adjusted(ReferenceData).
adjustment - the business day adjustment to apply to the unadjusted datefirstDate - the first dateremainingDates - the remaining dates, in orderpublic static AdjustableDates of(BusinessDayAdjustment adjustment, List<LocalDate> dates)
This creates an instance from the unadjusted dates and business day adjustment.
The adjusted dates are accessible via adjusted(ReferenceData).
adjustment - the business day adjustment to apply to the unadjusted datedates - the dates, in orderpublic ImmutableList<LocalDate> adjusted(ReferenceData refData)
This returns the adjusted dates, calculated by applying the business day adjustment to each unadjusted date. Duplicates are removed.
refData - the reference data to usepublic ImmutableList<AdjustableDate> toAdjustableDateList()
AdjustableDate equivalent to this instance.public String toString()
public static AdjustableDates.Meta meta()
AdjustableDates.public AdjustableDates.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic ImmutableList<LocalDate> getUnadjusted()
These dates may be non-business days. The business day adjustment is used to ensure each date is a valid business day.
public BusinessDayAdjustment getAdjustment()
This is used to adjust each date if it is not a business day.
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.