Class CurveNodeDate

  • All Implemented Interfaces:
    java.io.Serializable, Bean, ImmutableBean

    public final class CurveNodeDate
    extends java.lang.Object
    implements ImmutableBean, java.io.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 for CurveNodeDate.
    • 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
      java.time.LocalDate calculate​(java.util.function.Supplier<java.time.LocalDate> endDateSupplier, java.util.function.Supplier<java.time.LocalDate> lastFixingDateSupplier)
      Calculates the appropriate date for the node.
      boolean equals​(java.lang.Object obj)  
      java.time.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​(java.time.LocalDate date)
      Obtains an instance specifying a fixed date.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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​(java.time.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 java.time.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:
        java.lang.IllegalStateException - if called when the type is not fixed
      • calculate

        public java.time.LocalDate calculate​(java.util.function.Supplier<java.time.LocalDate> endDateSupplier,
                                             java.util.function.Supplier<java.time.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
      • 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
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object