public final class AdjustableDate extends Object implements ImmutableBean, Serializable
This class combines an unadjusted date and the business day adjustment necessary to adjust it.
Calling the adjusted(ReferenceData)
method will return the adjusted date.
Modifier and Type | Class and Description |
---|---|
static class |
AdjustableDate.Meta
The meta-bean for
AdjustableDate . |
Modifier and Type | Method and Description |
---|---|
LocalDate |
adjusted(ReferenceData refData)
Adjusts the date using the business day adjustment.
|
boolean |
equals(Object obj) |
BusinessDayAdjustment |
getAdjustment()
Gets the business day adjustment that is to be applied to the unadjusted date.
|
LocalDate |
getUnadjusted()
Gets the unadjusted date.
|
int |
hashCode() |
static AdjustableDate.Meta |
meta()
The meta-bean for
AdjustableDate . |
AdjustableDate.Meta |
metaBean() |
static AdjustableDate |
of(LocalDate date)
Obtains an instance with no business day adjustment.
|
static AdjustableDate |
of(LocalDate unadjusted,
BusinessDayAdjustment adjustment)
Obtains an instance with a business day adjustment.
|
<R> Property<R> |
property(String propertyName) |
Set<String> |
propertyNames() |
String |
toString()
Returns a string describing the adjustable date.
|
public static AdjustableDate of(LocalDate date)
This creates an adjustable date from the specified date.
No business day adjustment applies, thus the result of adjusted(ReferenceData)
is the specified date.
date
- the datepublic static AdjustableDate of(LocalDate unadjusted, BusinessDayAdjustment adjustment)
This creates an adjustable date from the unadjusted date and business day adjustment.
The adjusted date is accessible via adjusted(ReferenceData)
.
unadjusted
- the unadjusted dateadjustment
- the business day adjustment to apply to the unadjusted datepublic LocalDate adjusted(ReferenceData refData)
This returns the adjusted date, calculated by applying the business day adjustment to the unadjusted date.
refData
- the reference data to usepublic String toString()
public static AdjustableDate.Meta meta()
AdjustableDate
.public AdjustableDate.Meta metaBean()
public Set<String> propertyNames()
propertyNames
in interface Bean
public LocalDate getUnadjusted()
This date may be a non-business day. The business day adjustment is used to ensure it is a valid business day.
public BusinessDayAdjustment getAdjustment()
This is used to adjust the 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.