Class LegAmounts

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

    public final class LegAmounts
    extends Object
    implements FxConvertible<LegAmounts>, org.joda.beans.ImmutableBean, 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​(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
      • metaBean

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

        public ImmutableList<LegAmount> getAmounts()
        Gets the leg amounts.
        Returns:
        the value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object