Class AdjustableDate

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

    public final class AdjustableDate
    extends java.lang.Object
    implements ImmutableBean, java.io.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
    • Method Detail

      • of

        public static AdjustableDate of​(java.time.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​(java.time.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 date
        adjustment - the business day adjustment to apply to the unadjusted date
        Returns:
        the adjustable date
      • adjusted

        public java.time.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 java.lang.String toString()
        Returns a string describing the adjustable date.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the descriptive string
      • meta

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

        public java.time.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
      • 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