Class RatePaymentPeriod

  • All Implemented Interfaces:
    NotionalPaymentPeriod, SwapPaymentPeriod, java.io.Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class RatePaymentPeriod
    extends java.lang.Object
    implements NotionalPaymentPeriod, org.joda.beans.ImmutableBean, java.io.Serializable
    A period over which a rate of interest is paid.

    A swap leg consists of one or more periods that are the basis of accrual. The payment period is formed from one or more accrual periods which detail the type of interest to be accrued, fixed or floating.

    This class specifies the data necessary to calculate the value of the period. Any combination of accrual periods is supported in the data model, however there is no guarantee that exotic combinations will price sensibly.

    See Also:
    Serialized Form
    • Method Detail

      • getStartDate

        public java.time.LocalDate getStartDate()
        Gets the accrual start date of the period.

        This is the first accrual date in the period. This date has typically been adjusted to be a valid business day.

        Specified by:
        getStartDate in interface SwapPaymentPeriod
        Returns:
        the start date of the period
      • getEndDate

        public java.time.LocalDate getEndDate()
        Gets the accrual end date of the period.

        This is the last accrual date in the period. This date has typically been adjusted to be a valid business day.

        Specified by:
        getEndDate in interface SwapPaymentPeriod
        Returns:
        the end date of the period
      • getNotionalAmount

        public CurrencyAmount getNotionalAmount()
        Gets the notional amount, positive if receiving, negative if paying.

        This is the notional amount applicable during the period. The currency of the notional is specified by currency unless there is the fxReset property is present.

        Specified by:
        getNotionalAmount in interface NotionalPaymentPeriod
        Returns:
        the notional as a CurrencyAmount
      • getFxResetObservation

        public java.util.Optional<FxIndexObservation> getFxResetObservation()
        Description copied from interface: NotionalPaymentPeriod
        Gets the FX reset observation, optional.

        This property is used when the defined amount of the notional is specified in a currency other than the currency of the swap leg. When this occurs, the notional amount has to be converted using an FX rate to the swap leg currency.

        The FX reset definition must be valid. The currency of the period and the currency of the notional must differ, and the currency pair must be that of the observation.

        Specified by:
        getFxResetObservation in interface NotionalPaymentPeriod
        Returns:
        the optional FX reset observation
      • isCompoundingApplicable

        public boolean isCompoundingApplicable()
        Checks whether compounding applies.

        Compounding applies if there is more than one accrual period and the compounding method is not 'None'.

        Returns:
        true if compounding applies
      • adjustPaymentDate

        public RatePaymentPeriod adjustPaymentDate​(java.time.temporal.TemporalAdjuster adjuster)
        Description copied from interface: SwapPaymentPeriod
        Adjusts the payment date using the rules of the specified adjuster.

        The adjuster is typically an instance of BusinessDayAdjustment. Implementations must return a new instance unless they are immutable and no change occurs.

        Specified by:
        adjustPaymentDate in interface SwapPaymentPeriod
        Parameters:
        adjuster - the adjuster to apply to the payment date
        Returns:
        the adjusted payment event
      • collectIndices

        public void collectIndices​(ImmutableSet.Builder<Index> builder)
        Description copied from interface: SwapPaymentPeriod
        Collects all the indices referred to by this period.

        A period will typically refer to at least one index, such as 'GBP-LIBOR-3M'. Each index that is referred to must be added to the specified builder.

        Specified by:
        collectIndices in interface SwapPaymentPeriod
        Parameters:
        builder - the builder to use
      • meta

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

        public static RatePaymentPeriod.Builder builder()
        Returns a builder used to create an instance of the bean.
        Returns:
        the builder, not null
      • metaBean

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

        public java.time.LocalDate getPaymentDate()
        Gets the date that payment occurs.

        The date that payment is made for the accrual periods. If the schedule adjusts for business days, then this is the adjusted date.

        Specified by:
        getPaymentDate in interface SwapPaymentPeriod
        Returns:
        the value of the property, not null
      • getAccrualPeriods

        public ImmutableList<RateAccrualPeriod> getAccrualPeriods()
        Gets the accrual periods that combine to form the payment period.

        Each accrual period includes the applicable dates and details of how to observe the rate. In most cases, there will be one accrual period. If there is more than one accrual period then compounding may apply.

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

        public DayCount getDayCount()
        Gets the day count convention.

        Each accrual period contains a year fraction calculated using this day count. This day count is used when there is a need to perform further calculations.

        Returns:
        the value of the property, not null
      • getCurrency

        public Currency getCurrency()
        Gets the primary currency of the payment period.

        This is the currency of the swap leg and the currency that interest calculation is made in.

        The amounts of the notional are usually expressed in terms of this currency, however they can be converted from amounts in a different currency. See the optional fxReset property.

        Specified by:
        getCurrency in interface SwapPaymentPeriod
        Returns:
        the value of the property, not null
      • getFxReset

        public java.util.Optional<FxReset> getFxReset()
        Gets the FX reset definition, optional.

        This property is used when the defined amount of the notional is specified in a currency other than the currency of the swap leg. When this occurs, the notional amount has to be converted using an FX rate to the swap leg currency.

        The FX reset definition must be valid. It must have a reference currency that is different to that of this period, and the currency of this period must be one of those defined by the FX reset index.

        Returns:
        the optional value of the property, not null
      • getNotional

        public double getNotional()
        Gets the notional amount, positive if receiving, negative if paying.

        The notional amount applicable during the period. The currency of the notional is specified by currency unless there is the fxReset property is present.

        Returns:
        the value of the property
      • getCompoundingMethod

        public CompoundingMethod getCompoundingMethod()
        Gets the compounding method to use when there is more than one accrual period, default is 'None'.

        Compounding is used when combining accrual periods.

        Returns:
        the value of the property, not null
      • toBuilder

        public RatePaymentPeriod.Builder toBuilder()
        Returns a builder that allows this bean to be mutated.
        Returns:
        the mutable builder, not null
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object