Class IborRateCalculation.Builder

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

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

      • dayCount

        public IborRateCalculation.Builder dayCount​(DayCount dayCount)
        Sets the day count convention.

        This is used to convert dates to a numerical value.

        When building, this will default to the day count of the index if not specified.

        Parameters:
        dayCount - the new value, not null
        Returns:
        this, for chaining, not null
      • index

        public IborRateCalculation.Builder index​(IborIndex index)
        Sets the Ibor index.

        The rate to be paid is based on this index It will be a well known market index such as 'GBP-LIBOR-3M'.

        Parameters:
        index - the new value, not null
        Returns:
        this, for chaining, not null
      • resetPeriods

        public IborRateCalculation.Builder resetPeriods​(ResetSchedule resetPeriods)
        Sets the reset schedule, used when averaging rates, optional.

        Most swaps have a single fixing for each accrual period. This property allows multiple fixings to be defined by dividing the accrual periods into reset periods.

        If this property is not present, then the reset period is the same as the accrual period. If this property is present, then the accrual period is divided as per the information in the reset schedule, multiple fixing dates are calculated, and rate averaging performed.

        Parameters:
        resetPeriods - the new value
        Returns:
        this, for chaining, not null
      • fixingRelativeTo

        public IborRateCalculation.Builder fixingRelativeTo​(FixingRelativeTo fixingRelativeTo)
        Sets the base date that each fixing is made relative to, defaulted to 'PeriodStart'.

        The fixing date is relative to either the start or end of each reset period.

        Note that in most cases, the reset frequency matches the accrual frequency and thus there is only one fixing for the accrual period.

        Parameters:
        fixingRelativeTo - the new value, not null
        Returns:
        this, for chaining, not null
      • fixingDateOffset

        public IborRateCalculation.Builder fixingDateOffset​(DaysAdjustment fixingDateOffset)
        Sets the offset of the fixing date from each adjusted reset date.

        The offset is applied to the base date specified by fixingRelativeTo. The offset is typically a negative number of business days.

        Note that in most cases, the reset frequency matches the accrual frequency and thus there is only one fixing for the accrual period.

        When building, this will default to the fixing offset of the index if not specified.

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

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

        This is used when the interest rate, observed or calculated, goes negative. It does not apply if the rate is fixed, such as in a stub or using firstRegularRate.

        Defined by the 2006 ISDA definitions article 6.4.

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

        public IborRateCalculation.Builder firstRegularRate​(Double firstRegularRate)
        Sets the rate of the first regular reset period, optional. A 5% rate will be expressed as 0.05.

        In certain circumstances two counterparties agree the rate of the first fixing when the contract starts, and it is used in place of one observed fixing. For all other fixings, the rate is observed via the normal fixing process.

        This property allows the rate of the first reset period of the first regular accrual period to be controlled. Note that if there is an initial stub, this will be the second reset period. Other calculation elements, such as gearing or spread, still apply to the rate specified here.

        If the first rate applies to the initial stub rather than the regular accrual periods it must be specified using initialStub. Alternatively, firstRate can be used.

        This property follows the definition in FpML. See also firstRate.

        Parameters:
        firstRegularRate - the new value
        Returns:
        this, for chaining, not null
      • firstRate

        public IborRateCalculation.Builder firstRate​(Double firstRate)
        Sets the rate of the first reset period, which may be a stub, optional. A 5% rate will be expressed as 0.05.

        In certain circumstances two counterparties agree the rate of the first fixing when the contract starts, and it is used in place of one observed fixing. For all other fixings, the rate is observed via the normal fixing process.

        This property allows the rate of the first reset period to be controlled, irrespective of whether that is an initial stub or a regular period. Other calculation elements, such as gearing or spread, still apply to the rate specified here.

        This property is similar to firstRegularRate. This property operates on the first reset period, whether that is an initial stub or a regular period. By contrast, firstRegularRate operates on the first regular period, and never on a stub.

        If either firstRegularRate or initialStub are present, this property is ignored.

        If this property is not present, then the first rate is observed via the normal fixing process.

        Parameters:
        firstRate - the new value
        Returns:
        this, for chaining, not null
      • firstFixingDateOffset

        public IborRateCalculation.Builder firstFixingDateOffset​(DaysAdjustment firstFixingDateOffset)
        Sets the offset of the first fixing date from the first adjusted reset date, optional.

        If present, this offset is used instead of fixingDateOffset for the first reset period of the swap, which will be either an initial stub or the first reset period of the first regular accrual period.

        The offset is applied to the base date specified by fixingRelativeTo. The offset is typically a negative number of business days.

        If this property is not present, then the fixingDateOffset applies to all fixings.

        Parameters:
        firstFixingDateOffset - the new value
        Returns:
        this, for chaining, not null
      • initialStub

        public IborRateCalculation.Builder initialStub​(IborRateStubCalculation initialStub)
        Sets the rate to be used in initial stub, optional.

        The initial stub of a swap may have different rate rules to the regular accrual periods. A fixed rate may be specified, a different floating rate or a linearly interpolated floating rate. This may not be present if there is no initial stub, or if the index during the stub is the same as the main floating rate index.

        If this property is not present, then the main index applies during any initial stub. If this property is present and there is no initial stub, it is ignored.

        Parameters:
        initialStub - the new value
        Returns:
        this, for chaining, not null
      • finalStub

        public IborRateCalculation.Builder finalStub​(IborRateStubCalculation finalStub)
        Sets the rate to be used in final stub, optional.

        The final stub of a swap may have different rate rules to the regular accrual periods. A fixed rate may be specified, a different floating rate or a linearly interpolated floating rate. This may not be present if there is no final stub, or if the index during the stub is the same as the main floating rate index.

        If this property is not present, then the main index applies during any final stub. If this property is present and there is no final stub, it is ignored.

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

        public IborRateCalculation.Builder gearing​(ValueSchedule gearing)
        Sets the gearing multiplier, optional.

        This defines the gearing as an initial value and a list of adjustments. The gearing is only permitted to change at accrual period boundaries.

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

        If this property is not present, then no gearing applies.

        Gearing is also known as leverage.

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

        public IborRateCalculation.Builder spread​(ValueSchedule spread)
        Sets the spread rate, with a 5% rate expressed as 0.05, optional.

        This defines the spread as an initial value and a list of adjustments. The spread is only permitted to change at accrual period boundaries. Spread is a per annum rate.

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

        If this property is not present, then no spread applies.

        Defined by the 2006 ISDA definitions article 6.2e.

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

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