com.ibm.commerce.price.utils

Class PriceOutputCase

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


  • public class PriceOutputCase
    extends java.lang.Object
    PriceOutputCase represents one instance of all the information related to a single price calculation returned by GetContractUnitPriceCmd, GetContractSpecialPriceCmd, or GetProductContractUnitPriceCmd . This class is useful for combining the output from two or more of these commands as is done in CompositeGetContractUnitPriceCmdImpl, or as just a way to convert the output to a standard form to process the commands in a uniform way.

    There is one factory method which create lists of output cases from other objects:

    • AbstractGetPriceCmdImpl#createFromOutput(GetPriceCmdOutput)
    Output cases may later be converted into a command output object by using the PriceOutputCaseGetPriceCmdOutput class.
    • Constructor Summary

      Constructors 
      Constructor and Description
      PriceOutputCase(java.lang.Long newCatEntryID, java.lang.Long newTradingID, java.lang.Long newTCID, QuantityAmount newQuantity, com.ibm.commerce.order.objects.OfferAccessBean newOffer, java.lang.Long newOfferID, MonetaryAmount newBasePrice, MonetaryAmount newPrice)
      Constructor for PriceOutputCase.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      MonetaryAmount getBasePrice()
      Returns the base price that was found.
      java.lang.Long getCatEntryID()
      Returns the catalog entry that was used.
      java.util.ArrayList getMatchKey()
      Returns the key used to match input to output cases.
      com.ibm.commerce.order.objects.OfferAccessBean getOffer()
      Returns the offer access bean that was used.
      java.lang.Long getOfferID()
      Returns the offer that was used.
      MonetaryAmount getPrice()
      Returns the final calculated price.
      QuantityAmount getQuantity()
      Returns the quantity that was used.
      java.lang.Long getTcID()
      Returns the term condition that was used.
      java.lang.Long getTradingID()
      Returns the trading agreement that was used.
      void setToIndex(int i, CatEntryPrices catEntry)
      Sets the values from this to the values in the appropriate arrays in the given catalog entry object.
      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

      • PriceOutputCase

        public PriceOutputCase(java.lang.Long newCatEntryID,
                               java.lang.Long newTradingID,
                               java.lang.Long newTCID,
                               QuantityAmount newQuantity,
                               com.ibm.commerce.order.objects.OfferAccessBean newOffer,
                               java.lang.Long newOfferID,
                               MonetaryAmount newBasePrice,
                               MonetaryAmount newPrice)
        Constructor for PriceOutputCase.
        Parameters:
        newCatEntryID - The catalog entry identifier. Cannot be null.
        newTradingID - The trading agreement identifier. Cannot be null.
        newTCID - The term condition identifier. Cannot be null.
        newQuantity - The quantity used to determine the price. Cannot be null, and the unit of measure cannot be null or empty.
        newOffer - The offer that was used. May be null if no offer was used.
        newOfferID - The offer identifier that was used. May be null if no offer was used.
        newBasePrice - The base price that was found, if there was no offer in the requested currency. May be null if there was an offer in the requested currency or offers were not used to calculate the price.
        newPrice - The final price that was calculated. Cannot be null.
    • Method Detail

      • getBasePrice

        public MonetaryAmount getBasePrice()
        Returns the base price that was found. If no offer was found in the requested input currency, another offer in a different currency will be used, then converted to the requested currency using some calculations. The price before conversion is the base price.
        Returns:
        The base price that was found. This value will be null if the offer in the requested currency was found, or no offers were used to calculate the price.
      • getCatEntryID

        public java.lang.Long getCatEntryID()
        Returns the catalog entry that was used.
        Returns:
        The catalog entry identifier that was used to calculate the price. Will not be null.
      • 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.
      • getOffer

        public com.ibm.commerce.order.objects.OfferAccessBean getOffer()
        Returns the offer access bean that was used.
        Returns:
        The offer access bean that was used to calculate the price. This value will be null if offers were not used to calculate the price.
      • getOfferID

        public java.lang.Long getOfferID()
        Returns the offer that was used.
        Returns:
        The offer that was used to calculate the price. This value will be null if offers were not used to calculate the price.
      • getPrice

        public MonetaryAmount getPrice()
        Returns the final calculated price.
        Returns:
        The final calculated price. Will not be null.
      • getQuantity

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

        public java.lang.Long getTcID()
        Returns the term condition that was used.
        Returns:
        The term condition that was used to calculate the price. Will not be null.
      • getTradingID

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

        public void setToIndex(int i,
                               CatEntryPrices catEntry)
        Sets the values from this to the values in the appropriate arrays in the given catalog entry object. Before calling this method, CatEntryPrices.initOutput(int) should be called with the number of prices that were calculated for the catalog entry.
        Parameters:
        i - The index into the arrays to set the values. Must be >= 0 and < the length of catEntry.getAllTradingIDs.
        catEntry - The catalog entry information object to add the information from this to. Cannot be null, and must represent the same catalog entry as this.
      • 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.