Class SwapLegAmount

  • All Implemented Interfaces:
    FxConvertible<LegAmount>, LegAmount, java.io.Serializable, Bean, ImmutableBean

    public final class SwapLegAmount
    extends java.lang.Object
    implements LegAmount, ImmutableBean, java.io.Serializable
    Represents an amount associated with one leg of a swap.

    The amount is supplemented with details which would typically identify the swap leg. These are useful in order to interpret the amount without reference to the full product.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static SwapLegAmount of​(ResolvedSwapLeg leg,
                                       CurrencyAmount amount)
        Obtains an instance from a swap leg and amount.
        Parameters:
        leg - the swap leg
        amount - the amount
        Returns:
        the swap leg amount
      • convertedTo

        public SwapLegAmount convertedTo​(Currency resultCurrency,
                                         FxRateProvider rateProvider)
        Description copied from interface: FxConvertible
        Converts this instance to an equivalent amount in the specified currency.

        The result, which may be of a different type, will be expressed in terms of the given currency. Any FX conversion that is required will use rates from the provider.

        Specified by:
        convertedTo in interface FxConvertible<LegAmount>
        Parameters:
        resultCurrency - the currency of the result
        rateProvider - the provider of FX rates
        Returns:
        the converted instance, which should be expressed in the specified currency
      • meta

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

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

        public CurrencyAmount getAmount()
        Gets the amount associated with the leg. The meaning associated with this amount is implied by the context. This amount may have been currency converted.
        Specified by:
        getAmount in interface LegAmount
        Returns:
        the value of the property, not null
      • getPayReceive

        public PayReceive getPayReceive()
        Gets whether the leg is pay or receive.
        Returns:
        the value of the property, not null
      • getType

        public SwapLegType getType()
        Gets the type of the leg, such as Fixed or Ibor.
        Returns:
        the value of the property, not null
      • getCurrency

        public Currency getCurrency()
        Gets the currency of the leg. This is not be affected by any currency conversion applied to the amount.
        Returns:
        the value of the property, not null
      • toBuilder

        public SwapLegAmount.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