Class AdjustableDate

  • All Implemented Interfaces:
    Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class AdjustableDate
    extends Object
    implements org.joda.beans.ImmutableBean, 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​(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​(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 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 String toString()
        Returns a string describing the adjustable date.
        Overrides:
        toString in class Object
        Returns:
        the descriptive string
      • meta

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

        public AdjustableDate.Meta metaBean()
        Specified by:
        metaBean in interface org.joda.beans.Bean
      • getUnadjusted

        public 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object