com.ibm.retail.saf.provider
Class DefaultPriceRequest

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--java.util.HashMap
              |
              +--com.ibm.retail.saf.provider.POSInfoImpl
                    |
                    +--com.ibm.retail.saf.provider.POSRequestImpl
                          |
                          +--com.ibm.retail.saf.provider.DefaultPriceRequest
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, POSInfo, POSRequest, PriceRequest, java.io.Serializable

public class DefaultPriceRequest
extends POSRequestImpl
implements PriceRequest

Provides a list of item numbers and qualifying information needed to determine unit price information for the list of items. Item numbers in the list are distinct. A price request may contain one or more distinct item numbers and may also contain other information such as loyalty ID which may affect the selling price of an item.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.retail.saf.provider.POSRequestImpl
clientID, requestID
 
Fields inherited from class java.util.HashMap
 
Fields inherited from class java.util.AbstractMap
 
Fields inherited from interface com.ibm.retail.saf.provider.PriceRequest
DISCOUNT_PRICE, REGULAR_PRICE
 
Constructor Summary
DefaultPriceRequest()
          Constructs a PriceRequest with an empty list of items.
 
Method Summary
 void addItem(com.ibm.retail.saf.provider.ItemIdentifier itemID)
          Adds an ItemIdentifier to the request.
 java.lang.String getAlternateLoyaltyID()
          Gets the alternate loyalty or customer number defined for this price request.
 java.lang.String getCustomerLoyaltyID()
          Gets the customer's loyalty identifier defined for this price request.
 java.util.Set getItemList()
          Gets the list of ItemIdentifiers contained in the request.
 byte getPriceType()
          Gets the price type of this request.
 void removeItem(com.ibm.retail.saf.provider.ItemIdentifier itemID)
          Removes an ItemIdentifier from the request.
 void setAlternateLoyaltyID(java.lang.String altID)
          Sets the alternate loyalty or customer number for this price request.
 void setCustomerLoyaltyID(java.lang.String customerID)
          Sets a customer's loyalty identifier for this price request.
 void setPriceType(byte priceType)
          Sets the price type of this request.
 
Methods inherited from class com.ibm.retail.saf.provider.POSRequestImpl
getClientID, getRequestIdentifier, setRequestIdentifier
 
Methods inherited from class com.ibm.retail.saf.provider.POSInfoImpl
getExtendedAttribute, getExtendedAttributeNames, removeExtendedAttribute, setExtendedAttribute
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.retail.saf.provider.POSRequest
getClientID, getRequestIdentifier
 
Methods inherited from interface com.ibm.retail.saf.provider.POSInfo
getExtendedAttribute, getExtendedAttributeNames, removeExtendedAttribute, setExtendedAttribute
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

DefaultPriceRequest

public DefaultPriceRequest()
Constructs a PriceRequest with an empty list of items.

Method Detail

getPriceType

public byte getPriceType()
Gets the price type of this request.

A REGULAR_PRICE request is used to determine the non-discounted unit price. A DISCOUNT_PRICE request is used to determine the discounted unit price.

Discounted prices incorporate discounts for loyalty programs and other discounts which may be applied to the regular price.

Specified by:
getPriceType in interface PriceRequest
Returns:
price type

getCustomerLoyaltyID

public java.lang.String getCustomerLoyaltyID()
Gets the customer's loyalty identifier defined for this price request.

The loyalty identifier is used only for determining discounted prices. It is ignored for price type of REGULAR.

Specified by:
getCustomerLoyaltyID in interface PriceRequest
Returns:
loyalty ID

getAlternateLoyaltyID

public java.lang.String getAlternateLoyaltyID()
Gets the alternate loyalty or customer number defined for this price request. The alternate identifier is used as a substitute lookup to determine the customer loyalty number.

The alternate identifier is used only for determining discounted prices in the case that no loyalty ID is provided or the loyalty ID is invalid. It is ignored for price type of REGULAR.

Specified by:
getAlternateLoyaltyID in interface PriceRequest

setPriceType

public void setPriceType(byte priceType)
Sets the price type of this request.

A REGULAR_PRICE request is used to determine the non-discounted unit price. A DISCOUNT_PRICE request is used to determine the discounted unit price.

Discounted prices incorporate discounts for loyalty programs and other discounts which may be applied to the regular price.

Specified by:
setPriceType in interface PriceRequest
Parameters:
priceType - the type of pricing desired.

setCustomerLoyaltyID

public void setCustomerLoyaltyID(java.lang.String customerID)
Sets a customer's loyalty identifier for this price request. This identifier is used to determine discounted prices.

Specified by:
setCustomerLoyaltyID in interface PriceRequest
Parameters:
customerID - the loyalty ID of the customer

setAlternateLoyaltyID

public void setAlternateLoyaltyID(java.lang.String altID)
Sets the alternate loyalty or customer number for this price request. This identifier is used as a substitute lookup to determine the customer loyalty number.

Specified by:
setAlternateLoyaltyID in interface PriceRequest
Parameters:
altID - alternate loyalty ID of the customer

getItemList

public java.util.Set getItemList()
Description copied from interface: PriceRequest
Gets the list of ItemIdentifiers contained in the request.

If no item list exists, a null is returned.

Objects in the item list are of type ItemIdentifier. This identifier is the number used to sell the item at the point-of-sale register. Examples include UPC, SKU, or PLU codes.

Specified by:
getItemList in interface PriceRequest
Returns:
item list as a set of ItemIdentifiers

addItem

public void addItem(com.ibm.retail.saf.provider.ItemIdentifier itemID)
Description copied from interface: PriceRequest
Adds an ItemIdentifier to the request.

Duplicate item identifiers in a list are not allowed.

Specified by:
addItem in interface PriceRequest
Parameters:
itemID - an ItemIdentifier to be added

removeItem

public void removeItem(com.ibm.retail.saf.provider.ItemIdentifier itemID)
Description copied from interface: PriceRequest
Removes an ItemIdentifier from the request.

Specified by:
removeItem in interface PriceRequest
Parameters:
itemID - an ItemIdentifier to be removed.