The class is thread-safe, which is also true for all functions returned by this class.
MonetaryAmount money = Money.parse("EUR 2.35");
MonetaryAmount result = operator.apply(money);
Or using:
MonetaryAmount money = Money.parse("EUR 2.35");
MonetaryAmount result = money.with(operator);
MonetaryAmount#with(MonetaryOperator), MonetaryOperator, MonetaryOperator#apply(MonetaryAmount)
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static MonetaryOperator | Returns: the major part asMonetaryOperatorthe currency to be used currencyUnit)Do exchange of currency, in other words, create the monetary amount with the same value but with currency different. |
| public static Collector | Returns: the MonetarySummaryStatisticsthe target currencyUnit, ExchangeRateProvider provider)javax.of the summary of the MonetaryAmount |
| ConversionOperators | back to summary |
|---|---|
| private ConversionOperators() | |
| exchange | back to summary |
|---|---|
| public static MonetaryOperator exchange(CurrencyUnit currencyUnit) Do exchange of currency, in other words, create the monetary amount with the same value but with currency different. For example, 'EUR 2.35', using the currency 'USD' as exchange parameter, will return 'USD 2.35', and 'BHD -1.345', using the currency 'USD' as exchange parameter, will return 'BHD -1.345'.
| |
| summarizingMonetary | back to summary |
|---|---|
| public static Collector of the summary of the MonetaryAmount
| |