Class PriceFunctionImpl

java.lang.Object
com.commercetools.api.models.shipping_method.PriceFunctionImpl
All Implemented Interfaces:
PriceFunction, io.vrap.rmf.base.client.ModelBase

public class PriceFunctionImpl extends Object implements PriceFunction, io.vrap.rmf.base.client.ModelBase
PriceFunction
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase

    io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
  • Constructor Summary

    Constructors
    Constructor
    Description
    create empty instance
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Currency code compliant to ISO 4217.
    To calculate a Price based on the score, use +, -, * and parentheses.
    int
     
    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

      public String getCurrencyCode()

      Currency code compliant to ISO 4217.

      Specified by:
      getCurrencyCode in interface PriceFunction
      Returns:
      currencyCode
    • getFunction

      public String getFunction()

      To calculate a Price based on the score, use +, -, * and parentheses. The score is inserted with x. The function returns the cent amount.

      For example, to charge $1.99 for a score of 1, $3.99 for a score of 2, $5.99 for a score of 3 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 interface PriceFunction
      Returns:
      function
    • setCurrencyCode

      public void setCurrencyCode(String currencyCode)
      Description copied from interface: PriceFunction

      Currency code compliant to ISO 4217.

      Specified by:
      setCurrencyCode in interface PriceFunction
      Parameters:
      currencyCode - value to be set
    • setFunction

      public void setFunction(String function)
      Description copied from interface: PriceFunction

      To calculate a Price based on the score, use +, -, * and parentheses. The score is inserted with x. The function returns the cent amount.

      For example, to charge $1.99 for a score of 1, $3.99 for a score of 2, $5.99 for a score of 3 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 interface PriceFunction
      Parameters:
      function - value to be set
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object