public final class CurveNodeDate extends Object implements org.joda.beans.ImmutableBean, Serializable
A CurveNodeDate provides a flexible mechanism of defining the date of the curve node.
It may be associated with the end date, the last fixing date, or specified exactly.
| Modifier and Type | Class and Description |
|---|---|
static class |
CurveNodeDate.Meta
The meta-bean for
CurveNodeDate. |
| Modifier and Type | Field and Description |
|---|---|
static CurveNodeDate |
END
An instance defining the curve node date as the end date of the trade.
|
static CurveNodeDate |
LAST_FIXING
An instance defining the curve node date as the last fixing date date of the trade.
|
| Modifier and Type | Method and Description |
|---|---|
LocalDate |
calculate(Supplier<LocalDate> endDateSupplier,
Supplier<LocalDate> lastFixingDateSupplier)
Calculates the appropriate date for the node.
|
boolean |
equals(Object obj) |
LocalDate |
getDate()
Gets the node date if the type is 'Fixed'.
|
CurveNodeDateType |
getType()
Gets the method by which the date of the node is calculated, defaulted to 'End'.
|
int |
hashCode() |
boolean |
isEnd()
Checks if the type is 'End'.
|
boolean |
isFixed()
Checks if the type is 'Fixed'.
|
boolean |
isLastFixing()
Checks if the type is 'LastFixing'.
|
static CurveNodeDate.Meta |
meta()
The meta-bean for
CurveNodeDate. |
CurveNodeDate.Meta |
metaBean() |
static CurveNodeDate |
of(LocalDate date)
Obtains an instance specifying a fixed date.
|
String |
toString() |
public static final CurveNodeDate END
public static final CurveNodeDate LAST_FIXING
public static CurveNodeDate of(LocalDate date)
This returns an instance with the type CurveNodeDateType.FIXED.
date - the specific datepublic boolean isEnd()
public boolean isLastFixing()
public boolean isFixed()
public LocalDate getDate()
If the type is 'Fixed', this returns the node date. Otherwise, this throws an exception.
IllegalStateException - if called when the type is not fixedpublic LocalDate calculate(Supplier<LocalDate> endDateSupplier, Supplier<LocalDate> lastFixingDateSupplier)
endDateSupplier - the supplier invoked to get the end datelastFixingDateSupplier - the supplier invoked to get the last fixing datepublic static CurveNodeDate.Meta meta()
CurveNodeDate.public CurveNodeDate.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic CurveNodeDateType getType()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.