Class CurveNodeDate
- java.lang.Object
-
- com.opengamma.strata.market.curve.CurveNodeDate
-
- All Implemented Interfaces:
Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class CurveNodeDate extends Object implements org.joda.beans.ImmutableBean, Serializable
The date of the curve node.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.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CurveNodeDate.Meta
The meta-bean forCurveNodeDate
.
-
Field Summary
Fields Modifier and Type Field 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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 forCurveNodeDate
.CurveNodeDate.Meta
metaBean()
static CurveNodeDate
of(LocalDate date)
Obtains an instance specifying a fixed date.String
toString()
-
-
-
Field Detail
-
END
public static final CurveNodeDate END
An instance defining the curve node date as the end date of the trade.
-
LAST_FIXING
public static final CurveNodeDate LAST_FIXING
An instance defining the curve node date as the last fixing date date of the trade. Used only for instruments referencing an Ibor index.
-
-
Method Detail
-
of
public static CurveNodeDate of(LocalDate date)
Obtains an instance specifying a fixed date.This returns an instance with the type
CurveNodeDateType.FIXED
.- Parameters:
date
- the specific date- Returns:
- an instance specifying a fixed date
-
isEnd
public boolean isEnd()
Checks if the type is 'End'.- Returns:
- true if the type is 'End'
-
isLastFixing
public boolean isLastFixing()
Checks if the type is 'LastFixing'.- Returns:
- true if the type is 'LastFixing'
-
isFixed
public boolean isFixed()
Checks if the type is 'Fixed'.- Returns:
- true if the type is 'Fixed'
-
getDate
public LocalDate getDate()
Gets the node date if the type is 'Fixed'.If the type is 'Fixed', this returns the node date. Otherwise, this throws an exception.
- Returns:
- the node date, only available if the type is 'Fixed'
- Throws:
IllegalStateException
- if called when the type is not fixed
-
calculate
public LocalDate calculate(Supplier<LocalDate> endDateSupplier, Supplier<LocalDate> lastFixingDateSupplier)
Calculates the appropriate date for the node.- Parameters:
endDateSupplier
- the supplier invoked to get the end datelastFixingDateSupplier
- the supplier invoked to get the last fixing date- Returns:
- the calculated date
-
meta
public static CurveNodeDate.Meta meta()
The meta-bean forCurveNodeDate
.- Returns:
- the meta-bean, not null
-
metaBean
public CurveNodeDate.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getType
public CurveNodeDateType getType()
Gets the method by which the date of the node is calculated, defaulted to 'End'.- Returns:
- the value of the property
-
-