Package de.hybris.platform.util
Class PriceValue
java.lang.Object
de.hybris.platform.util.PriceValue
- All Implemented Interfaces:
PDTValue,Serializable
default price value object. this object tells whether a price is net or gross and which currency (iso code) this
price belongs to.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPriceValue(String currencyIso, double price, boolean netto) Creates a new price value. -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe currency iso code of this price.getOtherPrice(double relativeTotalTaxes) converts this price into another price with opposing net/gross state.getOtherPrice(double relativeTotalTaxes, double absoluteTotalTaxes) converts this price into another price with opposing net/gross state.getOtherPrice(Collection taxValues) converts this price into another price with opposing net/gross state.doublegetValue()The numeric value of this price.inthashCode()booleanisNet()Tells if this value includes taxes or not.static PriceValueparsePriceValue(String str) static CollectiontoString()static final StringtoString(Collection prices)
-
Constructor Details
-
PriceValue
Creates a new price value.- Parameters:
price- the value of this pricenetto- determines if the value includes taxes or not ( true = netto = no taxes )currencyIso- the currency iso code for this price
-
-
Method Details
-
getOtherPrice
converts this price into another price with opposing net/gross state. this requires to specify all taxes which apply to this price (without taxes net == gross ;) the price is not rounded here!- Parameters:
relativeTotalTaxes- the sum of all relative taxes e.g. 16% + 7% = 23%- Returns:
- a new price value instance holding the converted price
-
getOtherPrice
converts this price into another price with opposing net/gross state. this requires to specify all taxes which apply to this price (without taxes net == gross ;) the price is not rounded here!- Parameters:
relativeTotalTaxes- the sum of all relative taxes e.g. 16% + 7% = 23%absoluteTotalTaxes- the sum of all absolute taxes - no currency conversion here !!!- Returns:
- a new price value instance holding the converted price
-
getOtherPrice
converts this price into another price with opposing net/gross state. this requires to specify all taxes which apply to this price (without taxes net == gross ;) the price is not rounded here!- Parameters:
taxValues- a collection of tax values which apply to this price- Returns:
- a new price value instance holding the converted price
-
toString
-
toString
-
parsePriceValueCollection
- Throws:
IllegalArgumentException
-
parsePriceValue
- Throws:
IllegalArgumentException
-
getValue
public double getValue()The numeric value of this price. -
isNet
public boolean isNet()Tells if this value includes taxes or not. Which taxes apply to this price (whether they are included or not) is specified by @link #getTaxPKs().- Returns:
- true if no taxes are included in the value
-
getCurrencyIso
The currency iso code of this price. -
hashCode
public int hashCode() -
equals
-