Class 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
    • 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 date
        lastFixingDateSupplier - the supplier invoked to get the last fixing date
        Returns:
        the calculated date
      • meta

        public static CurveNodeDate.Meta meta()
        The meta-bean for CurveNodeDate.
        Returns:
        the meta-bean, not null
      • metaBean

        public CurveNodeDate.Meta metaBean()
        Specified by:
        metaBean in interface org.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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object