Class RateAccrualPeriod.Builder

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

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

      • startDate

        public RateAccrualPeriod.Builder startDate​(LocalDate startDate)
        Sets the start date of the accrual period.

        This is the first accrual date in the period. If the schedule adjusts for business days, then this is the adjusted date.

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

        public RateAccrualPeriod.Builder endDate​(LocalDate endDate)
        Sets the end date of the accrual period.

        This is the last accrual date in the period. If the schedule adjusts for business days, then this is the adjusted date.

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

        public RateAccrualPeriod.Builder unadjustedStartDate​(LocalDate unadjustedStartDate)
        Sets the unadjusted start date.

        The start date before any business day adjustment is applied.

        When building, this will default to the start date if not specified.

        Parameters:
        unadjustedStartDate - the new value, not null
        Returns:
        this, for chaining, not null
      • unadjustedEndDate

        public RateAccrualPeriod.Builder unadjustedEndDate​(LocalDate unadjustedEndDate)
        Sets the unadjusted end date.

        The end date before any business day adjustment is applied.

        When building, this will default to the end date if not specified.

        Parameters:
        unadjustedEndDate - the new value, not null
        Returns:
        this, for chaining, not null
      • yearFraction

        public RateAccrualPeriod.Builder yearFraction​(double yearFraction)
        Sets the year fraction that the accrual period represents.

        The value is usually calculated using a DayCount which may be different to that of the index. Typically the value will be close to 1 for one year and close to 0.5 for six months. The fraction may be greater than 1, but not less than 0.

        Parameters:
        yearFraction - the new value
        Returns:
        this, for chaining, not null
      • rateComputation

        public RateAccrualPeriod.Builder rateComputation​(RateComputation rateComputation)
        Sets the rate to be computed.

        The value of the period is based on this rate. Different implementations of the RateComputation interface have different approaches to computing the rate, including averaging, overnight and interpolation. For example, it might be a well known market index such as 'GBP-LIBOR-3M'.

        Parameters:
        rateComputation - the new value, not null
        Returns:
        this, for chaining, not null
      • gearing

        public RateAccrualPeriod.Builder gearing​(double gearing)
        Sets the gearing multiplier, defaulted to 1.

        This defines the gearing, which is used to multiply the observed rate.

        When calculating the rate, the observed rate is multiplied by the gearing. If both gearing and spread exist, then the gearing is applied first. A gearing of 1 has no effect.

        Gearing is also known as leverage.

        Parameters:
        gearing - the new value
        Returns:
        this, for chaining, not null
      • spread

        public RateAccrualPeriod.Builder spread​(double spread)
        Sets the spread rate, defaulted to 0. A 5% rate will be expressed as 0.05.

        This defines the spread, which is used to add an amount the observed rate.

        When calculating the rate, the spread is added to the observed rate. If both gearing and spread exist, then the gearing is applied first. A spread of 0 has no effect.

        Defined by the 2006 ISDA definitions article 6.2e.

        Parameters:
        spread - the new value
        Returns:
        this, for chaining, not null
      • negativeRateMethod

        public RateAccrualPeriod.Builder negativeRateMethod​(NegativeRateMethod negativeRateMethod)
        Sets the negative rate method, defaulted to 'AllowNegative'.

        This is used when the interest rate, observed or calculated, goes negative.

        When observing or calculating the rate, the value may go negative. If it does, then this method is used to validate whether the negative rate is allowed. It is applied after any applicable gearing or spread.

        Defined by the 2006 ISDA definitions article 6.4.

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

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