Class PriceFunctionImpl
- All Implemented Interfaces:
PriceFunction
,io.vrap.rmf.base.client.ModelBase
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase
io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Currency code compliant to ISO 4217.To calculate a Price based on the score, use+
,-
,*
and parentheses.int
hashCode()
void
setCurrencyCode
(String currencyCode) Currency code compliant to ISO 4217.void
setFunction
(String function) To calculate a Price based on the score, use+
,-
,*
and parentheses.Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.vrap.rmf.base.client.ModelBase
reflectionString, reflectionString
Methods inherited from interface com.commercetools.api.models.shipping_method.PriceFunction
withPriceFunction
-
Constructor Details
-
PriceFunctionImpl
public PriceFunctionImpl()create empty instance
-
-
Method Details
-
getCurrencyCode
Currency code compliant to ISO 4217.
- Specified by:
getCurrencyCode
in interfacePriceFunction
- Returns:
- currencyCode
-
getFunction
To calculate a Price based on the score, use
+
,-
,*
and parentheses. The score is inserted withx
. The function returns the cent amount.For example, to charge $1.99 for a score of
1
, $3.99 for a score of2
, $5.99 for a score of3
and onwards, the function is:(200 * x) - 1)
. To charge $4.50, $6.00, and $7.50 for express shipping, the function is:(150 * x) + 300
.- Specified by:
getFunction
in interfacePriceFunction
- Returns:
- function
-
setCurrencyCode
Description copied from interface:PriceFunction
Currency code compliant to ISO 4217.
- Specified by:
setCurrencyCode
in interfacePriceFunction
- Parameters:
currencyCode
- value to be set
-
setFunction
Description copied from interface:PriceFunction
To calculate a Price based on the score, use
+
,-
,*
and parentheses. The score is inserted withx
. The function returns the cent amount.For example, to charge $1.99 for a score of
1
, $3.99 for a score of2
, $5.99 for a score of3
and onwards, the function is:(200 * x) - 1)
. To charge $4.50, $6.00, and $7.50 for express shipping, the function is:(150 * x) + 300
.- Specified by:
setFunction
in interfacePriceFunction
- Parameters:
function
- value to be set
-
equals
-
hashCode
-