public class TaxValue extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable, PDTValue
| Constructor and Description |
|---|
TaxValue(java.lang.String code,
double value,
boolean absolute,
double appliedValue,
java.lang.String currencyIsoCode) |
TaxValue(java.lang.String code,
double value,
boolean absolute,
java.lang.String currencyIsoCode)
constructs a new TaxValue object.
|
| Modifier and Type | Method and Description |
|---|---|
TaxValue |
apply(double quantity,
double price,
int digits,
boolean priceIsNet,
java.lang.String currencyIsoCode)
creates a copy of this tax value holding the applied value for a given price rounded to given digits.
|
static java.util.Collection |
apply(double quantity,
double price,
int digits,
java.util.Collection taxValues,
boolean priceIsNet,
java.lang.String currencyIso)
creates a collection of applied tax values for a given price and a tax value collection.
|
java.lang.Object |
clone()
Returns an exact copy of the
TaxValue (@see java.lang.Object#clone()). |
boolean |
equals(java.lang.Object object) |
double |
getAppliedValue()
Returns the applied value of the
TaxValue. |
java.lang.String |
getCode()
Returns the code of the
TaxValue. |
java.lang.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(java.lang.String str)
creates a tax value object from its string representation created via @see #toString().
|
static java.util.Collection |
parseTaxValueCollection(java.lang.String str)
creates a tax value collection from its string representation created via @see #toString(Collection).
|
static double |
sumAbsoluteTaxValues(java.util.Collection taxValues) |
static double |
sumAppliedTaxValues(java.util.Collection taxValues) |
static double |
sumRelativeTaxValues(java.util.Collection taxValues) |
java.lang.String |
toString()
Returns a string representation of this tax value.
|
static java.lang.String |
toString(java.util.Collection taxValueCollection)
creates the string representation of a collection of tax values.
|
TaxValue |
unapply() |
public TaxValue(java.lang.String code,
double value,
boolean absolute,
java.lang.String currencyIsoCode)
code - value - absolute - currencyIsoCode - public TaxValue(java.lang.String code,
double value,
boolean absolute,
double appliedValue,
java.lang.String currencyIsoCode)
public java.lang.String getCode()
TaxValue.TaxValue.public java.lang.String getCurrencyIsoCode()
TaxValue or null if the tax value is
relative.public double getValue()
TaxValue.public double getAppliedValue()
TaxValue.TaxValue.public boolean isAbsolute()
true if this TaxValue is absolute.true if the TaxValue is absolute.public java.lang.Object clone()
TaxValue (@see java.lang.Object#clone()).clone in class java.lang.ObjectTaxValue:public TaxValue apply(double quantity, double price, int digits, boolean priceIsNet, java.lang.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 java.util.Collection apply(double quantity,
double price,
int digits,
java.util.Collection taxValues,
boolean priceIsNet,
java.lang.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(java.util.Collection taxValues)
public static double sumAbsoluteTaxValues(java.util.Collection taxValues)
public static double sumAppliedTaxValues(java.util.Collection taxValues)
public java.lang.String toString()
toString in class java.lang.Objectpublic static java.lang.String toString(java.util.Collection taxValueCollection)
taxValueCollection - a collection containing StandardTaxValuespublic static java.util.Collection parseTaxValueCollection(java.lang.String str)
throws java.lang.IllegalArgumentException
str - string representation of a TaxValue.java.lang.IllegalArgumentException - if a parse error occurredpublic static TaxValue parseTaxValue(java.lang.String str) throws java.lang.IllegalArgumentException
str - string representation of a TaxValue.java.lang.IllegalArgumentException - if the string is not validpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectpublic TaxValue unapply()
Copyright © 2018 SAP SE. All Rights Reserved.