Class 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 the PriceDataFactory to always create SubscriptionPricePlanData.
    Since:
    6.7
    See Also:
    Serialized Form
    • Constructor Detail

      • DefaultTmaPriceDataFactory

        public DefaultTmaPriceDataFactory()
    • Method Detail

      • create

        public SubscriptionPricePlanData create​(PriceDataType priceType,
                                                java.math.BigDecimal value,
                                                java.lang.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,
                                                java.math.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 java.math.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
      • formatPriceValue

        public java.lang.String formatPriceValue​(java.math.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