com.ibm.commerce.tools.catalog.util

Class RangePricing

  • java.lang.Object
    • com.ibm.commerce.tools.catalog.util.RangePricing
  • All Implemented Interfaces:
    java.lang.Comparable


    public class RangePricing
    extends java.lang.Object
    implements java.lang.Comparable
    A class used to represent a multi-currency ranged product/sku pricing.

    Behavior

    This class is used to gather data related to pricing a product across possible multiple currencies for specific range of purchased units. It is currently used to help abstract the data within the Commerce Accelerator pricing tool in such a way as to allow the developer to more easily implement product/sku pricing.

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT 
    • Constructor Summary

      Constructors 
      Constructor and Description
      RangePricing(java.lang.Double startUnits, java.util.Map currencyPrices)
      Creates an instance of PricingDataBean.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int compareTo(java.lang.Object rangePricingToCompare)
      Casts the object passed to a RangePricing object and returns -1 if this object has a lower starting unit value than cast object, 0 if they are the same, and 1 if this object has a higher starting unit value than the one to which it is being compared.
      int compareTo(RangePricing rangePricingToCompare)
      Returns -1 if the object has a lower starting unit value than rangePricingToCompare, 0 if they are the same, and 1 if the object has a higher starting unit value than the one to which it is being compared.
      java.math.BigDecimal getCurrencyPrice(java.lang.String currency)
      Returns the price per unit for this unit range in the currency passed.
      java.util.Map getCurrencyPrices()
      Returns the map of the price per unit for this unit range associated to a currency.
      java.lang.Double getStartingNumberOfUnits()
      Returns starting number of units for this unit range.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RangePricing

        public RangePricing(java.lang.Double startUnits,
                            java.util.Map currencyPrices)
        Creates an instance of PricingDataBean.
        Parameters:
        startUnits - The minimum number of units which must be purchased to qualify for this price.
        currencyPrices - The prices in each currency for which a price is defined.
    • Method Detail

      • compareTo

        public int compareTo(RangePricing rangePricingToCompare)
        Returns -1 if the object has a lower starting unit value than rangePricingToCompare, 0 if they are the same, and 1 if the object has a higher starting unit value than the one to which it is being compared.
        Returns:
        -1, 0, 1.
      • compareTo

        public int compareTo(java.lang.Object rangePricingToCompare)
        Casts the object passed to a RangePricing object and returns -1 if this object has a lower starting unit value than cast object, 0 if they are the same, and 1 if this object has a higher starting unit value than the one to which it is being compared.
        Specified by:
        compareTo in interface java.lang.Comparable
        Returns:
        -1, 0, 1.
      • getCurrencyPrice

        public java.math.BigDecimal getCurrencyPrice(java.lang.String currency)
        Returns the price per unit for this unit range in the currency passed.
        Parameters:
        currency - The currency for which to find the price per unit.
        Returns:
        The price per unit for this unit range in the currency passed.
      • getCurrencyPrices

        public java.util.Map getCurrencyPrices()
        Returns the map of the price per unit for this unit range associated to a currency.
        Returns:
        The map of a price associated to a currency.
      • getStartingNumberOfUnits

        public java.lang.Double getStartingNumberOfUnits()
        Returns starting number of units for this unit range.
        Returns:
        The starting number of units for this unit range.