Class AdjustableDates
- java.lang.Object
-
- com.opengamma.strata.basics.date.AdjustableDates
-
- All Implemented Interfaces:
Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class AdjustableDates extends Object implements org.joda.beans.ImmutableBean, Serializable
An adjustable list of dates.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.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AdjustableDates.Meta
The meta-bean forAdjustableDates
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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 forAdjustableDates
.AdjustableDates.Meta
metaBean()
static AdjustableDates
of(BusinessDayAdjustment adjustment, LocalDate firstDate, LocalDate... remainingDates)
Obtains an instance with a business day adjustment.static AdjustableDates
of(BusinessDayAdjustment adjustment, List<LocalDate> dates)
Obtains an instance with a business day adjustment.static AdjustableDates
of(LocalDate firstDate, LocalDate... remainingDates)
Obtains an instance with no business day adjustment.static AdjustableDates
of(List<LocalDate> dates)
Obtains an instance with no business day adjustment.ImmutableList<AdjustableDate>
toAdjustableDateList()
Returns a list ofAdjustableDate
equivalent to this instance.String
toString()
Returns a string describing the adjustable dates.
-
-
-
Method Detail
-
of
public static AdjustableDates of(LocalDate firstDate, LocalDate... remainingDates)
Obtains an instance with no business day adjustment.This creates an instance from the specified dates. No business day adjustment applies, thus the result of
adjusted(ReferenceData)
is the specified dates.- Parameters:
firstDate
- the first dateremainingDates
- the remaining dates, in order- Returns:
- the adjustable dates
-
of
public static AdjustableDates of(List<LocalDate> dates)
Obtains an instance with no business day adjustment.This creates an instance from the specified dates. No business day adjustment applies, thus the result of
adjusted(ReferenceData)
is the specified dates.- Parameters:
dates
- the dates, at least size 1, in order- Returns:
- the adjustable dates
-
of
public static AdjustableDates of(BusinessDayAdjustment adjustment, LocalDate firstDate, LocalDate... remainingDates)
Obtains an instance with a business day adjustment.This creates an instance from the unadjusted dates and business day adjustment. The adjusted dates are accessible via
adjusted(ReferenceData)
.- Parameters:
adjustment
- the business day adjustment to apply to the unadjusted datefirstDate
- the first dateremainingDates
- the remaining dates, in order- Returns:
- the adjustable dates
-
of
public static AdjustableDates of(BusinessDayAdjustment adjustment, List<LocalDate> dates)
Obtains an instance with a business day adjustment.This creates an instance from the unadjusted dates and business day adjustment. The adjusted dates are accessible via
adjusted(ReferenceData)
.- Parameters:
adjustment
- the business day adjustment to apply to the unadjusted datedates
- the dates, in order- Returns:
- the adjustable dates
-
adjusted
public ImmutableList<LocalDate> adjusted(ReferenceData refData)
Adjusts the dates using the business day adjustment.This returns the adjusted dates, calculated by applying the business day adjustment to each unadjusted date. Duplicates are removed.
- Parameters:
refData
- the reference data to use- Returns:
- the adjusted dates
-
toAdjustableDateList
public ImmutableList<AdjustableDate> toAdjustableDateList()
Returns a list ofAdjustableDate
equivalent to this instance.- Returns:
- the adjusted date
-
toString
public String toString()
Returns a string describing the adjustable dates.
-
meta
public static AdjustableDates.Meta meta()
The meta-bean forAdjustableDates
.- Returns:
- the meta-bean, not null
-
metaBean
public AdjustableDates.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getUnadjusted
public ImmutableList<LocalDate> getUnadjusted()
Gets the unadjusted dates, in order.These dates may be non-business days. The business day adjustment is used to ensure each date is a valid business day.
- Returns:
- the value of the property, not empty
-
getAdjustment
public BusinessDayAdjustment getAdjustment()
Gets the business day adjustment that is to be applied to the unadjusted dates.This is used to adjust each date if it is not a business day.
- Returns:
- the value of the property, not null
-
-