Interface TmaPriceDataFactory
- All Superinterfaces:
de.hybris.platform.commercefacades.product.PriceDataFactory,Serializable
- All Known Implementing Classes:
DefaultTmaPriceDataFactory
public interface TmaPriceDataFactory
extends de.hybris.platform.commercefacades.product.PriceDataFactory, Serializable
Custom implementation of the
PriceDataFactory.- Since:
- 6.7
-
Method Summary
Modifier and TypeMethodDescriptioncreate(PriceDataType priceType, BigDecimal value, CurrencyModel currency) Creates a PriceData object with a formatted currency string based on the price type and currency.create(PriceDataType priceType, BigDecimal value, String currencyIso) Creates a PriceData object with a formatted currency string based on the price type and currency ISO code.formatPriceValue(BigDecimal value, CurrencyModel currency) Obtains a formatted string for the given price value and currency.getPriceDataTypeForProduct(ProductModel product) Returns thePriceDataTypefor the given.getValueForPrice(PriceData price) Retrieves the price value of aPriceData.
-
Method Details
-
create
Creates 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- Parameters:
priceType- price type of the resulting price datavalue- price amountcurrencyIso- currency ISO code determining the currency- Returns:
- a newly created
SubscriptionPricePlanData
-
create
Creates a PriceData object with a formatted currency string based on the price type and currency.- Specified by:
createin interfacede.hybris.platform.commercefacades.product.PriceDataFactory- Parameters:
priceType- price type of the resulting price datavalue- price amountcurrency- currency to be used by the price- Returns:
- a newly created
SubscriptionPricePlanData
-
getValueForPrice
Retrieves 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
- Parameters:
price- price for which to retrieve the value- Returns:
- price value considering the priorities mentioned above
-
getPriceDataTypeForProduct
Returns thePriceDataTypefor the given.- Parameters:
product- product to retrieve the price data type for- Returns:
- price data type for the product given
-
formatPriceValue
Obtains a formatted string for the given price value and currency.- Parameters:
value- the price valuecurrency- the currency- Returns:
- formatted String with the price value and currency
-