com.ibm.etill.framework.cassette
Class PurchaseCardData

java.lang.Object
  |
  +--com.ibm.etill.framework.cassette.PurchaseCardData
All Implemented Interfaces:
Serializable

public final class PurchaseCardData
extends Object
implements Serializable

The PurchaseCardData object represents all purchase card details for a particular order.

See Also:
Serialized Form

Constructor Summary
PurchaseCardData(Map protocolData)
          Constructor for PurchaseCardData creates an instance based on the protocol data passed in.
 
Method Summary
static boolean containsPurchaseCardData(Map protocolData)
          Static utility method that returns true if the collection passed in contains purchase card protocol data.
 int getNumberOfLineItems()
          Returns the maximum number of line items based on the internal pCardData HashMap.
static int getNumberOfLineItems(Map protocolData)
          Returns the number of line items specified in the protocol data collection.
 int getNumberOfLineItems(String protocolDataKey)
          Returns the number of line items of the specified input type.
 Object getValue(String key)
          Returns the value of the specified purchase card item.
 boolean isEmpty()
          Returns true if there is no purchasing card data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PurchaseCardData

public PurchaseCardData(Map protocolData)
Constructor for PurchaseCardData creates an instance based on the protocol data passed in.
Parameters:
protocolData - collection of protocol data keywords
Method Detail

isEmpty

public boolean isEmpty()
Returns true if there is no purchasing card data.

containsPurchaseCardData

public static boolean containsPurchaseCardData(Map protocolData)
Static utility method that returns true if the collection passed in contains purchase card protocol data.
Parameters:
protocolData - collection of protocol data keywords
Returns:
boolean true if the collection contains purchase card protocol data

getNumberOfLineItems

public static int getNumberOfLineItems(Map protocolData)
Returns the number of line items specified in the protocol data collection. In essence, it returns the largest suffix value found for the $ITEM protocol data. For example, if the following was in the protocol data collection: $ITEM.QUANTITY.1 = 5 $ITEM.DESCRIPTOR.1 = this is the first description $ITEM.QUANTITY.2 = 3 $ITEM.DESCRIPTOR.2 = this is the second description $ITEM.QUANTITY.3 = 27 then this method would return 3 for the number of line items.
Parameters:
protocolData - collection of protocol data keywords
Returns:
int number of line items contained in the PurchaseCardData.

getNumberOfLineItems

public int getNumberOfLineItems()
Returns the maximum number of line items based on the internal pCardData HashMap.
Returns:
int maximum number of line items contained in the PurchaseCardData.

getNumberOfLineItems

public int getNumberOfLineItems(String protocolDataKey)
Returns the number of line items of the specified input type.
Parameters:
protocolData - collection of protocol data keywords
Returns:
int number of line items, of type protocolData, contained in the PurchaseCardData.

getValue

public Object getValue(String key)
Returns the value of the specified purchase card item.
Parameters:
key - the fully qualified name of the purchasing card item. Note, that all purchase card items are defined in PaymentAPIConstants. If the target item is a repeating item like line item data then make sure that .PREFIX is part of the key e.g $ITEM.SKU.1
Returns:
Object value of the purchasing card item passed in.
See Also:
PaymentAPIConstants