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, Serializable

public class DefaultTmaPriceDataFactory extends de.hybris.platform.commercefacades.product.impl.DefaultPriceDataFactory implements TmaPriceDataFactory
Default implementation of the PriceDataFactory to always create SubscriptionPricePlanData.
Since:
6.7
See Also:
  • Constructor Details

    • DefaultTmaPriceDataFactory

      public DefaultTmaPriceDataFactory()
  • Method Details

    • create

      public SubscriptionPricePlanData create(PriceDataType priceType, BigDecimal value, String currencyIso)
      Description copied from interface: TmaPriceDataFactory
      Creates a PriceData object with a formatted currency string based on the price type and currency ISO code.
      Specified by:
      create in interface de.hybris.platform.commercefacades.product.PriceDataFactory
      Specified by:
      create in interface TmaPriceDataFactory
      Overrides:
      create in class de.hybris.platform.commercefacades.product.impl.DefaultPriceDataFactory
      Parameters:
      priceType - price type of the resulting price data
      value - price amount
      currencyIso - currency ISO code determining the currency
      Returns:
      a newly created SubscriptionPricePlanData
    • create

      public SubscriptionPricePlanData create(PriceDataType priceType, BigDecimal value, CurrencyModel currency)
      Description copied from interface: TmaPriceDataFactory
      Creates a PriceData object with a formatted currency string based on the price type and currency.
      Specified by:
      create in interface de.hybris.platform.commercefacades.product.PriceDataFactory
      Specified by:
      create in interface TmaPriceDataFactory
      Overrides:
      create in class de.hybris.platform.commercefacades.product.impl.DefaultPriceDataFactory
      Parameters:
      priceType - price type of the resulting price data
      value - price amount
      currency - currency to be used by the price
      Returns:
      a newly created SubscriptionPricePlanData
    • getValueForPrice

      public BigDecimal getValueForPrice(PriceData price)
      Description copied from interface: TmaPriceDataFactory
      Retrieves the price value of a PriceData. 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:
      getValueForPrice in interface TmaPriceDataFactory
      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: TmaPriceDataFactory
      Returns the PriceDataType for the given.
      Specified by:
      getPriceDataTypeForProduct in interface TmaPriceDataFactory
      Parameters:
      product - product to retrieve the price data type for
      Returns:
      price data type for the product given
    • formatPriceValue

      public String formatPriceValue(BigDecimal value, CurrencyModel currency)
      Description copied from interface: TmaPriceDataFactory
      Obtains a formatted string for the given price value and currency.
      Specified by:
      formatPriceValue in interface TmaPriceDataFactory
      Parameters:
      value - the price value
      currency - the currency
      Returns:
      formatted String with the price value and currency
    • createPriceData

      protected PriceData createPriceData()
      Overrides:
      createPriceData in class de.hybris.platform.commercefacades.product.impl.DefaultPriceDataFactory