Exemple #1
0
 /// <summary>
 /// Returns a copy of this {@code MultiCurrencyAmount} with the specified amount added.
 /// <para>
 /// This adds the specified amount to this monetary amount, returning a new object.
 /// If the currency is already present, the amount is added to the existing amount.
 /// If the currency is not yet present, the currency-amount is added to the map.
 /// The addition uses standard {@code double} arithmetic.
 /// </para>
 /// <para>
 /// This instance is immutable and unaffected by this method.
 ///
 /// </para>
 /// </summary>
 /// <param name="amountToAdd">  the amount to add </param>
 /// <returns> an amount based on this with the specified amount added </returns>
 public MultiCurrencyAmount plus(MultiCurrencyAmount amountToAdd)
 {
     ArgChecker.notNull(amountToAdd, "amountToAdd");
     return(Stream.concat(amounts.stream(), amountToAdd.stream()).collect(toMultiCurrencyAmount()));
 }