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