Class LegAmounts

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

    public final class LegAmounts
    extends java.lang.Object
    implements FxConvertible<LegAmounts>, ImmutableBean, java.io.Serializable
    A collection of leg amounts.

    Contains a list of individual leg amount objects, each representing an amount associated with one leg of an instrument. The order of the list is expected to be the same as the order in which the legs are defined on the instrument.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static LegAmounts of​(java.util.List<LegAmount> amounts)
        Returns an instance containing the specified leg amounts.
        Parameters:
        amounts - the individual leg amounts
        Returns:
        an instance containing the specified leg amounts
      • of

        public static LegAmounts of​(LegAmount... amounts)
        Returns an instance containing the specified leg amounts.
        Parameters:
        amounts - the individual leg amounts
        Returns:
        an instance containing the specified leg amounts
      • convertedTo

        public LegAmounts 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<LegAmounts>
        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 LegAmounts.Meta meta()
        The meta-bean for LegAmounts.
        Returns:
        the meta-bean, not null
      • getAmounts

        public com.google.common.collect.ImmutableList<LegAmount> getAmounts()
        Gets the leg amounts.
        Returns:
        the value of the property, 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