public final class PriceUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static javax.money.MonetaryAmount |
calculateAppliedTaxes(TaxedItemPrice taxedPrice)
Calculates the taxes applied to the pricing.
|
static javax.money.MonetaryAmount |
calculateGrossPrice(javax.money.MonetaryAmount amount,
TaxRate taxRate)
Calculates the gross price of the given amount according to its tax rate.
|
static javax.money.MonetaryAmount |
calculateNetPrice(javax.money.MonetaryAmount amount,
TaxRate taxRate)
Calculates the net price of the given amount according to its tax rate.
|
static javax.money.MonetaryAmount |
convertGrossToNetPrice(javax.money.MonetaryAmount grossAmount,
double taxRate)
Converts the given gross amount (i.e.
|
static javax.money.MonetaryAmount |
convertNetToGrossPrice(javax.money.MonetaryAmount netAmount,
double taxRate)
Converts the given net amount (i.e.
|
static javax.money.MonetaryAmount |
zeroAmount(javax.money.CurrencyUnit currency) |
public static javax.money.MonetaryAmount zeroAmount(javax.money.CurrencyUnit currency)
public static javax.money.MonetaryAmount calculateAppliedTaxes(TaxedItemPrice taxedPrice)
taxedPrice - the taxed pricepublic static javax.money.MonetaryAmount calculateGrossPrice(javax.money.MonetaryAmount amount,
TaxRate taxRate)
amount - the monetary amounttaxRate - the tax rate corresponding to the amountpublic static javax.money.MonetaryAmount calculateNetPrice(javax.money.MonetaryAmount amount,
TaxRate taxRate)
amount - the monetary amounttaxRate - the tax rate corresponding to the amountpublic static javax.money.MonetaryAmount convertNetToGrossPrice(javax.money.MonetaryAmount netAmount,
double taxRate)
netAmount - the net monetary amounttaxRate - the given tax rate, e.g. 0.19 for 19% taxpublic static javax.money.MonetaryAmount convertGrossToNetPrice(javax.money.MonetaryAmount grossAmount,
double taxRate)
grossAmount - the gross monetary amounttaxRate - the given tax rate, e.g. 0.19 for 19% tax