Class PeriodicSchedule.Builder

  • All Implemented Interfaces:
    org.joda.beans.BeanBuilder<PeriodicSchedule>
    Enclosing class:
    PeriodicSchedule

    public static final class PeriodicSchedule.Builder
    extends org.joda.beans.impl.direct.DirectFieldsBeanBuilder<PeriodicSchedule>
    The bean-builder for PeriodicSchedule.
    • Method Detail

      • get

        public Object get​(String propertyName)
        Specified by:
        get in interface org.joda.beans.BeanBuilder<PeriodicSchedule>
        Overrides:
        get in class org.joda.beans.impl.direct.DirectFieldsBeanBuilder<PeriodicSchedule>
      • startDate

        public PeriodicSchedule.Builder startDate​(LocalDate startDate)
        Sets the start date, which is the start of the first schedule period.

        This is the start date of the schedule, it is unadjusted and as such might be a weekend or holiday. Any applicable business day adjustment will be applied when creating the schedule. This is also known as the unadjusted effective date.

        In most cases, the start date of a financial instrument is just after the trade date, such as two business days later. However, the start date of a schedule is permitted to be any date, which includes dates before or after the trade date.

        Parameters:
        startDate - the new value, not null
        Returns:
        this, for chaining, not null
      • endDate

        public PeriodicSchedule.Builder endDate​(LocalDate endDate)
        Sets the end date, which is the end of the last schedule period.

        This is the end date of the schedule, it is unadjusted and as such might be a weekend or holiday. Any applicable business day adjustment will be applied when creating the schedule. This is also known as the unadjusted maturity date or unadjusted termination date. This date must be after the start date.

        Parameters:
        endDate - the new value, not null
        Returns:
        this, for chaining, not null
      • frequency

        public PeriodicSchedule.Builder frequency​(Frequency frequency)
        Sets the regular periodic frequency to use.

        Most dates are calculated using a regular periodic frequency, such as every 3 months. The actual day-of-month or day-of-week is selected using the roll and stub conventions.

        Parameters:
        frequency - the new value, not null
        Returns:
        this, for chaining, not null
      • businessDayAdjustment

        public PeriodicSchedule.Builder businessDayAdjustment​(BusinessDayAdjustment businessDayAdjustment)
        Sets the business day adjustment to apply.

        Each date in the calculated schedule is determined without taking into account weekends and holidays. The adjustment specified here is used to convert those dates to valid business days.

        The start date and end date may have their own business day adjustment rules. If those are not present, then this adjustment is used instead.

        Parameters:
        businessDayAdjustment - the new value, not null
        Returns:
        this, for chaining, not null
      • startDateBusinessDayAdjustment

        public PeriodicSchedule.Builder startDateBusinessDayAdjustment​(BusinessDayAdjustment startDateBusinessDayAdjustment)
        Sets the optional business day adjustment to apply to the start date.

        The start date property is an unadjusted date and as such might be a weekend or holiday. The adjustment specified here is used to convert the start date to a valid business day.

        If this property is not present, the standard businessDayAdjustment property is used instead.

        Parameters:
        startDateBusinessDayAdjustment - the new value
        Returns:
        this, for chaining, not null
      • endDateBusinessDayAdjustment

        public PeriodicSchedule.Builder endDateBusinessDayAdjustment​(BusinessDayAdjustment endDateBusinessDayAdjustment)
        Sets the optional business day adjustment to apply to the end date.

        The end date property is an unadjusted date and as such might be a weekend or holiday. The adjustment specified here is used to convert the end date to a valid business day.

        If this property is not present, the standard businessDayAdjustment property is used instead.

        Parameters:
        endDateBusinessDayAdjustment - the new value
        Returns:
        this, for chaining, not null
      • stubConvention

        public PeriodicSchedule.Builder stubConvention​(StubConvention stubConvention)
        Sets the optional convention defining how to handle stubs.

        The stub convention is used during schedule construction to determine whether the irregular remaining period occurs at the start or end of the schedule. It also determines whether the irregular period is shorter or longer than the regular period. This property interacts with the "explicit dates" of PeriodicSchedule.getFirstRegularStartDate() and PeriodicSchedule.getLastRegularEndDate().

        The convention 'None' may be used to explicitly indicate there are no stubs. There must be no explicit dates. This will be validated during schedule construction.

        The convention 'Both' may be used to explicitly indicate there is both an initial and final stub. The stubs themselves must be specified using explicit dates. This will be validated during schedule construction.

        The conventions 'ShortInitial', 'LongInitial', 'SmartInitial', 'ShortFinal', 'LongFinal' and 'SmartFinal' are used to indicate the type of stub to be generated. The exact behavior varies depending on whether there are explicit dates or not:

        If explicit dates are specified, then the combination of stub convention an explicit date will be validated during schedule construction. For example, the combination of an explicit dated initial stub and a stub convention of 'ShortInitial', 'LongInitial' or 'SmartInitial' is valid, but other stub conventions, such as 'ShortFinal' or 'None' would be invalid.

        If explicit dates are not specified, then it is not required that a stub is generated. The convention determines whether to generate dates from the start date forward, or the end date backwards. Date generation may or may not result in a stub, but if it does then the stub will be of the correct type.

        When the stub convention is not present, the generation of stubs is based on the presence or absence of the explicit dates. When there are no explicit stubs and there is a roll convention that matches the start or end date, then the stub convention will be defaulted to 'SmartInitial' or 'SmartFinal'.

        Parameters:
        stubConvention - the new value
        Returns:
        this, for chaining, not null
      • rollConvention

        public PeriodicSchedule.Builder rollConvention​(RollConvention rollConvention)
        Sets the optional convention defining how to roll dates.

        The schedule periods are determined at the high level by repeatedly adding the frequency to the start date, or subtracting it from the end date. The roll convention provides the detailed rule to adjust the day-of-month or day-of-week.

        During schedule generation, if this is present it will be used to determine the schedule. If not present, then the roll convention will be implied.

        Parameters:
        rollConvention - the new value
        Returns:
        this, for chaining, not null
      • firstRegularStartDate

        public PeriodicSchedule.Builder firstRegularStartDate​(LocalDate firstRegularStartDate)
        Sets the optional start date of the first regular schedule period, which is the end date of the initial stub.

        This is used to identify the boundary date between the initial stub and the first regular schedule period.

        This is an unadjusted date, and as such it might not be a valid business day. This date must be on or after 'startDate' and on or before 'endDate'.

        During schedule generation, if this is present it will be used to determine the schedule. If not present, then the overall schedule start date will be used instead, resulting in no initial stub.

        Parameters:
        firstRegularStartDate - the new value
        Returns:
        this, for chaining, not null
      • lastRegularEndDate

        public PeriodicSchedule.Builder lastRegularEndDate​(LocalDate lastRegularEndDate)
        Sets the optional end date of the last regular schedule period, which is the start date of the final stub.

        This is used to identify the boundary date between the last regular schedule period and the final stub.

        This is an unadjusted date, and as such it might not be a valid business day. This date must be one or after 'startDate', on or after 'firstRegularStartDate' and on or before 'endDate'.

        During schedule generation, if this is present it will be used to determine the schedule. If not present, then the overall schedule end date will be used instead, resulting in no final stub.

        Parameters:
        lastRegularEndDate - the new value
        Returns:
        this, for chaining, not null
      • overrideStartDate

        public PeriodicSchedule.Builder overrideStartDate​(AdjustableDate overrideStartDate)
        Sets the optional start date of the first schedule period, overriding normal schedule generation.

        This property is rarely used, and is generally needed when accrual starts before the effective date. If specified, it overrides the start date of the first period once schedule generation has been completed. Note that all schedule generation rules apply to 'startDate', with this applied as a final step. This field primarily exists to support the FpML 'firstPeriodStartDate' concept.

        If a roll convention is explicitly specified and the regular start date does not match it, then the override will be used when generating regular periods.

        If set, it should be different to the start date, although this is not validated. Validation does check that it is on or before 'firstRegularStartDate' and 'lastRegularEndDate', and before 'endDate'.

        During schedule generation, if this is present it will be used to override the start date of the first generated schedule period. If not present, then the start of the first period will be the normal start date.

        Parameters:
        overrideStartDate - the new value
        Returns:
        this, for chaining, not null
      • toString

        public String toString()
        Overrides:
        toString in class org.joda.beans.impl.direct.DirectFieldsBeanBuilder<PeriodicSchedule>