Class RatePeriodSwapLeg.Builder

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

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

      • type

        public RatePeriodSwapLeg.Builder type​(SwapLegType type)
        Sets the type of the leg, such as Fixed or Ibor.

        This provides a high level categorization of the swap leg.

        Parameters:
        type - the new value, not null
        Returns:
        this, for chaining, not null
      • payReceive

        public RatePeriodSwapLeg.Builder payReceive​(PayReceive payReceive)
        Sets whether the leg is pay or receive.

        A value of 'Pay' implies that the resulting amount is paid to the counterparty. A value of 'Receive' implies that the resulting amount is received from the counterparty. Note that negative interest rates can result in a payment in the opposite direction to that implied by this indicator.

        The value of this flag should match the signs of the payment period notionals.

        Parameters:
        payReceive - the new value, not null
        Returns:
        this, for chaining, not null
      • paymentPeriods

        public RatePeriodSwapLeg.Builder paymentPeriods​(List<RatePaymentPeriod> paymentPeriods)
        Sets the payment periods that combine to form the swap leg.

        Each payment period represents part of the life-time of the leg. In most cases, the periods do not overlap. However, since each payment period is essentially independent the data model allows overlapping periods.

        The start date and end date of the leg are determined from the first and last period. As such, the periods should be sorted.

        Parameters:
        paymentPeriods - the new value, not empty
        Returns:
        this, for chaining, not null
      • paymentPeriods

        public RatePeriodSwapLeg.Builder paymentPeriods​(RatePaymentPeriod... paymentPeriods)
        Sets the paymentPeriods property in the builder from an array of objects.
        Parameters:
        paymentPeriods - the new value, not empty
        Returns:
        this, for chaining, not null
      • initialExchange

        public RatePeriodSwapLeg.Builder initialExchange​(boolean initialExchange)
        Sets the flag indicating whether to exchange the initial notional.

        Setting this to true indicates that the notional is transferred at the start of the trade. This should typically be set to true in the case of an FX reset swap, or one with a varying notional.

        This flag controls whether a notional exchange object is created when the leg is resolved. It covers an exchange on the initial payment date of the swap leg, treated as the start date. If there is an FX reset, then this flag is ignored, see intermediateExchange. If there is no FX reset and the flag is true, then a NotionalExchange object will be created.

        Parameters:
        initialExchange - the new value
        Returns:
        this, for chaining, not null
      • intermediateExchange

        public RatePeriodSwapLeg.Builder intermediateExchange​(boolean intermediateExchange)
        Sets the flag indicating whether to exchange the differences in the notional during the lifetime of the swap.

        Setting this to true indicates that the notional is transferred when it changes during the trade. This should typically be set to true in the case of an FX reset swap, or one with a varying notional.

        This flag controls whether a notional exchange object is created when the leg is resolved. It covers an exchange on each intermediate payment date of the swap leg. If set to true, the behavior depends on whether an FX reset payment period is defined. If there is an FX reset, then an FxResetNotionalExchange object will be created. If there is no FX reset, then a NotionalExchange object will be created.

        Parameters:
        intermediateExchange - the new value
        Returns:
        this, for chaining, not null
      • finalExchange

        public RatePeriodSwapLeg.Builder finalExchange​(boolean finalExchange)
        Sets the flag indicating whether to exchange the final notional.

        Setting this to true indicates that the notional is transferred at the end of the trade. This should typically be set to true in the case of an FX reset swap, or one with a varying notional.

        This flag controls whether a notional exchange object is created when the leg is resolved. It covers an exchange on the final payment date of the swap leg. If there is an FX reset, then this flag is ignored, see intermediateExchange. If there is no FX reset and the flag is true, then a NotionalExchange object will be created.

        Parameters:
        finalExchange - the new value
        Returns:
        this, for chaining, not null
      • paymentEvents

        public RatePeriodSwapLeg.Builder paymentEvents​(List<SwapPaymentEvent> paymentEvents)
        Sets the additional payment events that are associated with the swap leg.

        Payment events include fees. Notional exchange may also be specified here instead of via the dedicated fields.

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

        public RatePeriodSwapLeg.Builder paymentEvents​(SwapPaymentEvent... paymentEvents)
        Sets the paymentEvents property in the builder from an array of objects.
        Parameters:
        paymentEvents - the new value, not null
        Returns:
        this, for chaining, not null
      • paymentBusinessDayAdjustment

        public RatePeriodSwapLeg.Builder paymentBusinessDayAdjustment​(BusinessDayAdjustment paymentBusinessDayAdjustment)
        Sets the business day date adjustment to be applied to each payment date, default is to apply no adjustment.

        The business day adjustment is applied to period, exchange and event payment dates.

        Parameters:
        paymentBusinessDayAdjustment - 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<RatePeriodSwapLeg>