Class DefaultTmaPriceDataFactory
- java.lang.Object
-
- de.hybris.platform.commercefacades.product.impl.DefaultPriceDataFactory
-
- de.hybris.platform.b2ctelcofacades.price.impl.DefaultTmaPriceDataFactory
-
- All Implemented Interfaces:
TmaPriceDataFactory,de.hybris.platform.commercefacades.product.PriceDataFactory,java.io.Serializable
public class DefaultTmaPriceDataFactory extends de.hybris.platform.commercefacades.product.impl.DefaultPriceDataFactory implements TmaPriceDataFactory
Default implementation of thePriceDataFactoryto always createSubscriptionPricePlanData.- Since:
- 6.7
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultTmaPriceDataFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SubscriptionPricePlanDatacreate(PriceDataType priceType, java.math.BigDecimal value, CurrencyModel currency)Creates a PriceData object with a formatted currency string based on the price type and currency.SubscriptionPricePlanDatacreate(PriceDataType priceType, java.math.BigDecimal value, java.lang.String currencyIso)Creates a PriceData object with a formatted currency string based on the price type and currency ISO code.protected PriceDatacreatePriceData()java.lang.StringformatPriceValue(java.math.BigDecimal value, CurrencyModel currency)Obtains a formatted string for the given price value and currency.PriceDataTypegetPriceDataTypeForProduct(ProductModel product)Returns thePriceDataTypefor the {@param product} given.java.math.BigDecimalgetValueForPrice(PriceData price)Retrieves the price value of aPriceData.-
Methods inherited from class de.hybris.platform.commercefacades.product.impl.DefaultPriceDataFactory
adjustDigits, adjustSymbol, createCurrencyFormat, createNumberFormat, formatPrice, getCommerceCommonI18NService, getCommonI18NService, getI18NService, setCommerceCommonI18NService, setCommonI18NService, setI18NService
-
-
-
-
Method Detail
-
create
public SubscriptionPricePlanData create(PriceDataType priceType, java.math.BigDecimal value, java.lang.String currencyIso)
Description copied from interface:TmaPriceDataFactoryCreates a PriceData object with a formatted currency string based on the price type and currency ISO code.- Specified by:
createin interfacede.hybris.platform.commercefacades.product.PriceDataFactory- Specified by:
createin interfaceTmaPriceDataFactory- Overrides:
createin classde.hybris.platform.commercefacades.product.impl.DefaultPriceDataFactory- Parameters:
priceType- price type of the resulting price datavalue- price amountcurrencyIso- currency ISO code determining the currency- Returns:
- a newly created
SubscriptionPricePlanData
-
create
public SubscriptionPricePlanData create(PriceDataType priceType, java.math.BigDecimal value, CurrencyModel currency)
Description copied from interface:TmaPriceDataFactoryCreates a PriceData object with a formatted currency string based on the price type and currency.- Specified by:
createin interfacede.hybris.platform.commercefacades.product.PriceDataFactory- Specified by:
createin interfaceTmaPriceDataFactory- Overrides:
createin classde.hybris.platform.commercefacades.product.impl.DefaultPriceDataFactory- Parameters:
priceType- price type of the resulting price datavalue- price amountcurrency- currency to be used by the price- Returns:
- a newly created
SubscriptionPricePlanData
-
getValueForPrice
public java.math.BigDecimal getValueForPrice(PriceData price)
Description copied from interface:TmaPriceDataFactoryRetrieves the price value of aPriceData. The priorities are the following:- if the price has recurring charges, return the first recurring charge
- if the price has a value, return the value
- if the price has one time charges, return the first one time charge
- Specified by:
getValueForPricein interfaceTmaPriceDataFactory- Parameters:
price- price for which to retrieve the value- Returns:
- price value considering the priorities mentioned above
-
getPriceDataTypeForProduct
public PriceDataType getPriceDataTypeForProduct(ProductModel product)
Description copied from interface:TmaPriceDataFactoryReturns thePriceDataTypefor the {@param product} given.- Specified by:
getPriceDataTypeForProductin interfaceTmaPriceDataFactory- Parameters:
product- product to retrieve the price data type for- Returns:
- price data type for the product given
-
formatPriceValue
public java.lang.String formatPriceValue(java.math.BigDecimal value, CurrencyModel currency)Description copied from interface:TmaPriceDataFactoryObtains a formatted string for the given price value and currency.- Specified by:
formatPriceValuein interfaceTmaPriceDataFactory- Parameters:
value- the price valuecurrency- the currency- Returns:
- formatted String with the price value and currency
-
createPriceData
protected PriceData createPriceData()
- Overrides:
createPriceDatain classde.hybris.platform.commercefacades.product.impl.DefaultPriceDataFactory
-
-