public class TaxValue extends Object implements Cloneable, Serializable
| Constructor and Description |
|---|
TaxValue(String code,
double value,
boolean absolute,
double appliedValue,
String currencyIsoCode) |
TaxValue(String code,
double value,
boolean absolute,
String currencyIsoCode)
constructs a new TaxValue object.
|
| Modifier and Type | Method and Description |
|---|---|
TaxValue |
apply(double quantity,
double price,
int digits,
boolean priceIsNet,
String currencyIsoCode)
creates a copy of this tax value holding the applied value for a given price rounded to given digits.
|
static Collection |
apply(double quantity,
double price,
int digits,
Collection taxValues,
boolean priceIsNet,
String currencyIso)
creates a collection of applied tax values for a given price and a tax value collection.
|
Object |
clone()
Returns an exact copy of the
TaxValue (@see java.lang.Object#clone()). |
boolean |
equals(Object object) |
double |
getAppliedValue()
Returns the applied value of the
TaxValue. |
String |
getCode()
Returns the code of the
TaxValue. |
String |
getCurrencyIsoCode()
Returns the currency iso code of this absolute
TaxValue or null if the tax value is
relative. |
double |
getValue()
Returns the value of the
TaxValue. |
int |
hashCode() |
boolean |
isAbsolute()
Returns
true if this TaxValue is absolute. |
static TaxValue |
parseTaxValue(String str)
creates a tax value object from its string representation created via @see #toString().
|
static Collection |
parseTaxValueCollection(String str)
creates a tax value collection from its string representation created via @see #toString(Collection).
|
static double |
sumAbsoluteTaxValues(Collection taxValues) |
static double |
sumAppliedTaxValues(Collection taxValues) |
static double |
sumRelativeTaxValues(Collection taxValues) |
String |
toString()
Returns a string representation of this tax value.
|
static String |
toString(Collection taxValueCollection)
creates the string representation of a collection of tax values.
|
TaxValue |
unapply() |
public TaxValue(String code, double value, boolean absolute, String currencyIsoCode)
code - value - absolute - currencyIsoCode - public String getCode()
TaxValue.TaxValue.public String getCurrencyIsoCode()
TaxValue or null if the tax value is
relative.public double getValue()
TaxValue.TaxValue.public double getAppliedValue()
TaxValue.TaxValue.public boolean isAbsolute()
true if this TaxValue is absolute.true if the TaxValue is absolute.public Object clone()
TaxValue (@see java.lang.Object#clone()).public TaxValue apply(double quantity, double price, int digits, boolean priceIsNet, String currencyIsoCode)
price - the price to apply this tax value todigits - the digits to round the value to, if < 0 no rounding is donepriceIsNet - true if the given price is net.TaxValue holding the applied value for a given price rounded to given
digits.public static Collection apply(double quantity, double price, int digits, Collection taxValues, boolean priceIsNet, String currencyIso)
price - the price to apply these taxes todigits - the number of digits to round, if < 0 no rounding is donetaxValues - the collection of taxes to apply to the pricepriceIsNet - true if given price is net, false if given price is grosspublic static double sumRelativeTaxValues(Collection taxValues)
public static double sumAbsoluteTaxValues(Collection taxValues)
public static double sumAppliedTaxValues(Collection taxValues)
public String toString()
public static String toString(Collection taxValueCollection)
taxValueCollection - a collection containing StandardTaxValuespublic static Collection parseTaxValueCollection(String str) throws IllegalArgumentException
str - string representation of a TaxValue.IllegalArgumentException - if a parse error occurredpublic static TaxValue parseTaxValue(String str) throws IllegalArgumentException
str - string representation of a TaxValue.IllegalArgumentException - if the string is not validpublic TaxValue unapply()
Copyright © 2017 SAP SE. All Rights Reserved.