public final class MonetaryFunctions extends Object
Modifier and Type | Method and Description |
---|---|
static java.util.function.Predicate<javax.money.MonetaryAmount> |
filterByExcludingCurrency(javax.money.CurrencyUnit... currencies)
Create predicate that filters by CurrencyUnit.
|
static java.util.stream.Collector<javax.money.MonetaryAmount,?,Map<javax.money.CurrencyUnit,List<javax.money.MonetaryAmount>>> |
groupByCurrencyUnit()
Collector to group by CurrencyUnit
|
static java.util.stream.Collector<javax.money.MonetaryAmount,GroupMonetarySummaryStatistics,GroupMonetarySummaryStatistics> |
groupBySummarizingMonetary()
of MonetaryAmount group by MonetarySummary
|
static java.util.function.Predicate<javax.money.MonetaryAmount> |
isBetween(javax.money.MonetaryAmount min,
javax.money.MonetaryAmount max)
Creates a filter using the isBetween predicate.
|
static java.util.function.Predicate<javax.money.MonetaryAmount> |
isCurrency(javax.money.CurrencyUnit... currencies)
Create predicate that filters by CurrencyUnit.
|
static java.util.function.Predicate<javax.money.MonetaryAmount> |
isGreaterThan(javax.money.MonetaryAmount amount)
Creates filter using isGreaterThan in MonetaryAmount.
|
static java.util.function.Predicate<javax.money.MonetaryAmount> |
isGreaterThanOrEqualTo(javax.money.MonetaryAmount amount)
Creates filter using isGreaterThanOrEqualTo in MonetaryAmount
|
static java.util.function.Predicate<javax.money.MonetaryAmount> |
isLessThan(javax.money.MonetaryAmount amount)
Creates filter using isLessThan in MonetaryAmount
|
static java.util.function.Predicate<javax.money.MonetaryAmount> |
isLessThanOrEqualTo(javax.money.MonetaryAmount amount)
Creates filter using isLessThanOrEqualTo in MonetaryAmount
|
static java.util.function.BinaryOperator<javax.money.MonetaryAmount> |
max()
Creates a BinaryOperator to calculate the maximum amount.
|
static java.util.function.BinaryOperator<javax.money.MonetaryAmount> |
max(javax.money.convert.ExchangeRateProvider provider)
return the maximum value, if the monetary amounts have different
currencies, will converter first using the given ExchangeRateProvider
|
static java.util.function.BinaryOperator<javax.money.MonetaryAmount> |
min()
Creates a BinaryOperator to calculate the minimum amount
|
static java.util.function.BinaryOperator<javax.money.MonetaryAmount> |
min(javax.money.convert.ExchangeRateProvider provider)
return the minimum value, if the monetary amounts have different
currencies, will converter first using the given ExchangeRateProvider
|
static Comparator<javax.money.MonetaryAmount> |
sortCurrencyUnit()
Get a comparator for sorting CurrencyUnits ascending.
|
static Comparator<javax.money.MonetaryAmount> |
sortCurrencyUnitDesc()
Get a comparator for sorting CurrencyUnits descending.
|
static Comparator<javax.money.MonetaryAmount> |
sortNumber()
Get a comparator for sorting amount by number value ascending.
|
static Comparator<javax.money.MonetaryAmount> |
sortNumberDesc()
Get a comparator for sorting amount by number value descending.
|
static Comparator<? super javax.money.MonetaryAmount> |
sortValiable(javax.money.convert.ExchangeRateProvider provider)
comparator to sort the
MonetaryAmount considering the
ExchangeRate |
static Comparator<? super javax.money.MonetaryAmount> |
sortValiableDesc(javax.money.convert.ExchangeRateProvider provider)
Descending order of
sortValiable(ExchangeRateProvider) |
static java.util.function.BinaryOperator<javax.money.MonetaryAmount> |
sum()
Creates a BinaryOperator to sum.
|
static java.util.function.BinaryOperator<javax.money.MonetaryAmount> |
sum(javax.money.convert.ExchangeRateProvider provider,
javax.money.CurrencyUnit currency)
return the sum and convert all values to specific currency using the
provider, if necessary
|
static javax.money.MonetaryAmount |
sum(javax.money.MonetaryAmount a,
javax.money.MonetaryAmount b)
Adds two monetary together
|
static java.util.stream.Collector<javax.money.MonetaryAmount,MonetarySummaryStatistics,MonetarySummaryStatistics> |
summarizingMonetary(javax.money.CurrencyUnit currencyUnit)
of the summary of the MonetaryAmount
|
static java.util.stream.Collector<javax.money.MonetaryAmount,MonetarySummaryStatistics,MonetarySummaryStatistics> |
summarizingMonetary(javax.money.CurrencyUnit currencyUnit,
javax.money.convert.ExchangeRateProvider provider)
of the summary of the MonetaryAmount
|
public static java.util.stream.Collector<javax.money.MonetaryAmount,?,Map<javax.money.CurrencyUnit,List<javax.money.MonetaryAmount>>> groupByCurrencyUnit()
public static java.util.stream.Collector<javax.money.MonetaryAmount,MonetarySummaryStatistics,MonetarySummaryStatistics> summarizingMonetary(javax.money.CurrencyUnit currencyUnit)
currencyUnit
- the target CurrencyUnit
public static java.util.stream.Collector<javax.money.MonetaryAmount,MonetarySummaryStatistics,MonetarySummaryStatistics> summarizingMonetary(javax.money.CurrencyUnit currencyUnit, javax.money.convert.ExchangeRateProvider provider)
currencyUnit
- the target CurrencyUnit
public static java.util.stream.Collector<javax.money.MonetaryAmount,GroupMonetarySummaryStatistics,GroupMonetarySummaryStatistics> groupBySummarizingMonetary()
public static Comparator<javax.money.MonetaryAmount> sortCurrencyUnit()
public static Comparator<? super javax.money.MonetaryAmount> sortValiable(javax.money.convert.ExchangeRateProvider provider)
MonetaryAmount
considering the
ExchangeRate
provider
- the rate provider to be used, not null.MonetaryAmount
using ExchangeRate
public static Comparator<? super javax.money.MonetaryAmount> sortValiableDesc(javax.money.convert.ExchangeRateProvider provider)
sortValiable(ExchangeRateProvider)
provider
- the rate provider to be used, not null.sortValiable(ExchangeRateProvider)
public static Comparator<javax.money.MonetaryAmount> sortCurrencyUnitDesc()
public static Comparator<javax.money.MonetaryAmount> sortNumber()
public static Comparator<javax.money.MonetaryAmount> sortNumberDesc()
public static java.util.function.Predicate<javax.money.MonetaryAmount> isCurrency(javax.money.CurrencyUnit... currencies)
currencies
- the target CurrencyUnit
public static java.util.function.Predicate<javax.money.MonetaryAmount> filterByExcludingCurrency(javax.money.CurrencyUnit... currencies)
currencies
- the target CurrencyUnit
instancespublic static java.util.function.Predicate<javax.money.MonetaryAmount> isGreaterThan(javax.money.MonetaryAmount amount)
amount
- the amount to be compared to.public static java.util.function.Predicate<javax.money.MonetaryAmount> isGreaterThanOrEqualTo(javax.money.MonetaryAmount amount)
amount
- the amount to be compared to.public static java.util.function.Predicate<javax.money.MonetaryAmount> isLessThan(javax.money.MonetaryAmount amount)
amount
- the amount to be compared to.public static java.util.function.Predicate<javax.money.MonetaryAmount> isLessThanOrEqualTo(javax.money.MonetaryAmount amount)
amount
- the amount to be compared to.public static java.util.function.Predicate<javax.money.MonetaryAmount> isBetween(javax.money.MonetaryAmount min, javax.money.MonetaryAmount max)
min
- min value inclusive, not null.max
- max value inclusive, not null.public static javax.money.MonetaryAmount sum(javax.money.MonetaryAmount a, javax.money.MonetaryAmount b)
a
- the first operandb
- the second operanda
and b
NullPointerException
- if a o b be nulljavax.money.MonetaryException
- if a and b have different currencypublic static java.util.function.BinaryOperator<javax.money.MonetaryAmount> sum()
public static java.util.function.BinaryOperator<javax.money.MonetaryAmount> sum(javax.money.convert.ExchangeRateProvider provider, javax.money.CurrencyUnit currency)
provider
- the rate provider to be used, not null.currency
- currencypublic static java.util.function.BinaryOperator<javax.money.MonetaryAmount> min()
public static java.util.function.BinaryOperator<javax.money.MonetaryAmount> min(javax.money.convert.ExchangeRateProvider provider)
provider
- the ExchangeRateProvider to convert the currenciespublic static java.util.function.BinaryOperator<javax.money.MonetaryAmount> max()
public static java.util.function.BinaryOperator<javax.money.MonetaryAmount> max(javax.money.convert.ExchangeRateProvider provider)
provider
- the ExchangeRateProvider to convert the currenciesCopyright © 2012-2015 JavaMoney. All Rights Reserved.