com.ibm.commerce.price.utils

Class PriceInputCase

  • java.lang.Object
    • com.ibm.commerce.price.utils.PriceInputCase


  • public class PriceInputCase
    extends java.lang.Object
    PriceInputCase represents one instance of all the information necessary to get a single price using GetContractUnitPriceCmd, GetContractSpecialPriceCmd, or GetProductContractUnitPriceCmd . This class is useful for splitting the input from one of these commands as is done in CompositeGetContractUnitPriceCmdImpl, or as just a way to convert the input to a standard form to process the commands in a uniform way.

    There are two factory methods which create lists of input cases from other objects:

    Input cases may later be converted into a command input object by using the PriceInputCaseGetPriceCmdInput class.
    • Constructor Summary

      Constructors 
      Constructor and Description
      PriceInputCase(java.lang.Integer newStoreID, java.lang.String newCurrency, java.lang.Long newOrganizationID, java.lang.Long newMemberID, java.lang.Long newTradingID, java.lang.Long newCatEntryID, MixList<java.lang.Long> newOfferIDs, QuantityAmount newQuantity, com.ibm.commerce.order.objects.OrderItemAccessBean newOrderItem, java.util.Map newCustomData)
      Constructor for PriceCase.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.util.List<PriceInputCase> createPriceCases(CatEntryPrices newCatEntry, java.lang.Integer newStoreID, java.lang.String newCurrency, java.lang.Long newOrganizationID, java.lang.Long newMemberID, MixList<java.lang.Long> inputTradingIDs)
      Returns price cases created from the given catalog entry information.
      static java.util.List<PriceInputCase> createPriceCases(GetPriceCmdInput input)
      Returns price cases created from the given command input object.
      java.lang.Long getCatEntryID()
      Returns the catalog entry to be used to calculate the price.
      java.lang.String getCurrency()
      Returns the currency to be used to calculate the price.
      java.util.Map getCustomData()
      Returns any custom data that is associated with the catalog entry.
      java.util.ArrayList getMatchKey()
      Returns the key used to match input to output cases.
      java.lang.Long getMemberID()
      Returns the member to be used to calculate the price.
      MixList<java.lang.Long> getOfferIDs()
      Returns the offers that should take precedence over other offers if applicable.
      com.ibm.commerce.order.objects.OrderItemAccessBean getOrderItem()
      Returns the order item given by the order component.
      java.lang.Long getOrganizationID()
      Returns the organization to be used to calculate the price.
      QuantityAmount getQuantity()
      Returns the quantity to be used to calculate the price.
      java.lang.Integer getStoreID()
      Returns the store to be used to calculate the price.
      java.lang.Long getTradingID()
      Returns the trading agreement to be used to calculate the price.
      java.lang.String toString()
      Returns the string representation of this.
      • Methods inherited from class java.lang.Object

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

      • PriceInputCase

        public PriceInputCase(java.lang.Integer newStoreID,
                              java.lang.String newCurrency,
                              java.lang.Long newOrganizationID,
                              java.lang.Long newMemberID,
                              java.lang.Long newTradingID,
                              java.lang.Long newCatEntryID,
                              MixList<java.lang.Long> newOfferIDs,
                              QuantityAmount newQuantity,
                              com.ibm.commerce.order.objects.OrderItemAccessBean newOrderItem,
                              java.util.Map newCustomData)
        Constructor for PriceCase.
        Parameters:
        newStoreID - The store identifier. Cannot be null.
        newCurrency - The 3-letter international currency code. Cannot be null or empty.
        newOrganizationID - The identifier of the organization that contains the member. Cannot be null.
        newMemberID - The identifier of the member, used to determine entitlement. Cannot be null.
        newTradingID - The trading agreement identifier. Cannot be null.
        newCatEntryID - The catalog entry identifier. Cannot be null.
        newOfferIDs - The offer IDs that take precedence when determining a price. Cannot be null, but may be empty.
        newQuantity - The quantity of the catalog entry. This is used to determine the quantity range which determines the price. Cannot be null.
        newOrderItem - The order item associated with the catalog entry. This is used by the order component. This value may be null.
        newCustomData - The custom data associated with the catalog entry. This value may be null or empty.
    • Method Detail

      • createPriceCases

        public static java.util.List<PriceInputCase> createPriceCases(CatEntryPrices newCatEntry,
                                                                      java.lang.Integer newStoreID,
                                                                      java.lang.String newCurrency,
                                                                      java.lang.Long newOrganizationID,
                                                                      java.lang.Long newMemberID,
                                                                      MixList<java.lang.Long> inputTradingIDs)
        Returns price cases created from the given catalog entry information.
        Parameters:
        newCatEntry - The catalog entry information to convert. Cannot be null.
        newStoreID - The store identifier. Cannot be null.
        newCurrency - The 3-letter international currency code. Cannot be null or empty.
        newOrganizationID - The identifier of the organization that contains the member. Cannot be null.
        newMemberID - The identifier of the member, used to determine entitlement. Cannot be null.
        inputTradingIDs - The trading IDs to use to create the price cases. These should be created using TradingManager.getBasePool(), using the trading agreement identifiers from newCatEntry for the batch mode identifiers input. This will ensure compatibility with previous behavior. Cannot be null. If empty, no price cases will be created.
        Returns:
        A list of price cases, which contains one for each trading agreement identifier in the given catalog entry information. Will not be null, but may be empty if no trading agreements are given.
      • createPriceCases

        public static java.util.List<PriceInputCase> createPriceCases(GetPriceCmdInput input)
        Returns price cases created from the given command input object.
        Parameters:
        input - The command input object which contains the input data to be split into price cases. Both single mode and batch mode are supported. Cannot be null.
        Returns:
        A list of price cases, which contains one for each trading agreement identifier in the given command input object. Will not be null, but may be empty if no trading agreements are given.
      • getCatEntryID

        public java.lang.Long getCatEntryID()
        Returns the catalog entry to be used to calculate the price.
        Returns:
        The catalog entry identifier to be used. Will not be null.
      • getCurrency

        public java.lang.String getCurrency()
        Returns the currency to be used to calculate the price.
        Returns:
        The 3-letter international currency code to be used. Will not be null or empty.
      • getCustomData

        public java.util.Map getCustomData()
        Returns any custom data that is associated with the catalog entry.
        Returns:
        The custom data that has been associated with the catalog entry. This value may be null or empty.
      • getMatchKey

        public java.util.ArrayList getMatchKey()
        Returns the key used to match input to output cases.
        Returns:
        The key used to match input to output cases.
      • getMemberID

        public java.lang.Long getMemberID()
        Returns the member to be used to calculate the price.
        Returns:
        The member identifier to be used. Will not be null.
      • getOfferIDs

        public MixList<java.lang.Long> getOfferIDs()
        Returns the offers that should take precedence over other offers if applicable.
        Returns:
        The offer identifiers to be used. A null or empty list indicates that there are no special offers, or offers are not used to determine price.
      • getOrderItem

        public com.ibm.commerce.order.objects.OrderItemAccessBean getOrderItem()
        Returns the order item given by the order component.
        Returns:
        The order item given by the order component. This value may be null.
      • getOrganizationID

        public java.lang.Long getOrganizationID()
        Returns the organization to be used to calculate the price.
        Returns:
        The organization identifier to be used. Will not be null.
      • getQuantity

        public QuantityAmount getQuantity()
        Returns the quantity to be used to calculate the price.
        Returns:
        The quantity to be used. Will not be null.
      • getStoreID

        public java.lang.Integer getStoreID()
        Returns the store to be used to calculate the price.
        Returns:
        The store identifier to be used. Will not be null.
      • getTradingID

        public java.lang.Long getTradingID()
        Returns the trading agreement to be used to calculate the price.
        Returns:
        The trading agreement identifier to be used. Will not be null.
      • toString

        public java.lang.String toString()
        Returns the string representation of this.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation of this. Will not be null or empty.