Class SwapLegAmount

  • All Implemented Interfaces:
    FxConvertible<LegAmount>, LegAmount, Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class SwapLegAmount
    extends Object
    implements LegAmount, org.joda.beans.ImmutableBean, 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.
        leg - the swap leg
        amount - the amount
        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>
        resultCurrency - the currency of the result
        rateProvider - the provider of FX rates
        the converted instance, which should be expressed in the specified currency
      • meta

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

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

        public SwapLegAmount.Meta metaBean()
        Specified by:
        metaBean in interface org.joda.beans.Bean
      • 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
        the value of the property, not null
      • getPayReceive

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

        public SwapLegType getType()
        Gets the type of the leg, such as Fixed or Ibor.
        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.
        the value of the property, not null
      • toBuilder

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

        public int hashCode()
        hashCode in class Object