Class AdjustableDates

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

    public final class AdjustableDates
    extends Object
    implements org.joda.beans.ImmutableBean, Serializable
    An adjustable list of dates.

    This class combines a list of unadjusted dates with the single business day adjustment necessary to adjust them. Calling the adjusted(ReferenceData) method will return the adjusted dates.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static AdjustableDates of​(LocalDate firstDate,
                                         LocalDate... remainingDates)
        Obtains an instance with no business day adjustment.

        This creates an instance from the specified dates. No business day adjustment applies, thus the result of adjusted(ReferenceData) is the specified dates.

        Parameters:
        firstDate - the first date
        remainingDates - the remaining dates, in order
        Returns:
        the adjustable dates
      • of

        public static AdjustableDates of​(List<LocalDate> dates)
        Obtains an instance with no business day adjustment.

        This creates an instance from the specified dates. No business day adjustment applies, thus the result of adjusted(ReferenceData) is the specified dates.

        Parameters:
        dates - the dates, at least size 1, in order
        Returns:
        the adjustable dates
      • of

        public static AdjustableDates of​(BusinessDayAdjustment adjustment,
                                         LocalDate firstDate,
                                         LocalDate... remainingDates)
        Obtains an instance with a business day adjustment.

        This creates an instance from the unadjusted dates and business day adjustment. The adjusted dates are accessible via adjusted(ReferenceData).

        Parameters:
        adjustment - the business day adjustment to apply to the unadjusted date
        firstDate - the first date
        remainingDates - the remaining dates, in order
        Returns:
        the adjustable dates
      • of

        public static AdjustableDates of​(BusinessDayAdjustment adjustment,
                                         List<LocalDate> dates)
        Obtains an instance with a business day adjustment.

        This creates an instance from the unadjusted dates and business day adjustment. The adjusted dates are accessible via adjusted(ReferenceData).

        Parameters:
        adjustment - the business day adjustment to apply to the unadjusted date
        dates - the dates, in order
        Returns:
        the adjustable dates
      • adjusted

        public ImmutableList<LocalDate> adjusted​(ReferenceData refData)
        Adjusts the dates using the business day adjustment.

        This returns the adjusted dates, calculated by applying the business day adjustment to each unadjusted date. Duplicates are removed.

        Parameters:
        refData - the reference data to use
        Returns:
        the adjusted dates
      • toAdjustableDateList

        public ImmutableList<AdjustableDate> toAdjustableDateList()
        Returns a list of AdjustableDate equivalent to this instance.
        Returns:
        the adjusted date
      • toString

        public String toString()
        Returns a string describing the adjustable dates.
        Overrides:
        toString in class Object
        Returns:
        the descriptive string
      • meta

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

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

        public ImmutableList<LocalDate> getUnadjusted()
        Gets the unadjusted dates, in order.

        These dates may be non-business days. The business day adjustment is used to ensure each date is a valid business day.

        Returns:
        the value of the property, not empty
      • getAdjustment

        public BusinessDayAdjustment getAdjustment()
        Gets the business day adjustment that is to be applied to the unadjusted dates.

        This is used to adjust each 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