Class FixedRateStubCalculation

  • All Implemented Interfaces:
    Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class FixedRateStubCalculation
    extends Object
    implements org.joda.beans.ImmutableBean, Serializable
    Defines the rate applicable in the initial or final stub of a fixed swap leg.

    A standard swap leg consists of a regular periodic schedule and one or two stub periods at each end. This class defines what fixed rate to use during a stub.

    The calculation may be specified in two ways.

    • A fixed rate, applicable for the whole stub
    • A fixed amount for the whole stub
    See Also:
    Serialized Form
    • Method Detail

      • ofFixedRate

        public static FixedRateStubCalculation ofFixedRate​(double fixedRate)
        Obtains an instance with a single fixed rate.
        Parameters:
        fixedRate - the fixed rate for the stub
        Returns:
        the stub
      • ofKnownAmount

        public static FixedRateStubCalculation ofKnownAmount​(CurrencyAmount knownAmount)
        Obtains an instance with a known amount of interest.
        Parameters:
        knownAmount - the known amount of interest
        Returns:
        the stub
      • isFixedRate

        public boolean isFixedRate()
        Checks if the stub has a fixed rate.
        Returns:
        true if a fixed rate applies
      • isKnownAmount

        public boolean isKnownAmount()
        Checks if the stub has a known amount.
        Returns:
        true if the stub has a known amount
      • getFixedRate

        public OptionalDouble getFixedRate()
        Gets the fixed rate to use in the stub. A 5% rate will be expressed as 0.05.

        If the fixed rate is present, then knownAmount must not be present.

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

        public Optional<CurrencyAmount> getKnownAmount()
        Gets the known amount to pay/receive for the stub.

        If the known amount is present, then fixedRate must not be present.

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

        public int hashCode()
        Overrides:
        hashCode in class Object