public class PriceUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM copyright notice field.
|
Constructor and Description |
---|
PriceUtil() |
Modifier and Type | Method and Description |
---|---|
static PriceDataBean |
getStandardPrice(java.lang.String catEntryID,
com.ibm.commerce.command.CommandContext cmdCtx)
Gets a PriceDataBean that represents the standard contract price for the item.
|
static PriceDataBean |
getStandardPrice(java.lang.String orderItemId,
com.ibm.commerce.command.CommandContext cmdCtx,
boolean forSingleUnit)
Gets the standard offer price for order item.
|
static PriceDataBean |
getStandardPrice(java.lang.String catEntryID,
com.ibm.commerce.command.CommandContext cmdCtx,
java.lang.String currency)
Gets a PriceDataBean that represents the standard contract price for the item.
|
static PriceDataBean |
getStandardPrice(java.lang.String catEntryID,
java.lang.String quantityToUse,
com.ibm.commerce.command.CommandContext cmdCtx,
java.lang.String currency,
boolean forSingleUnit)
Gets a PriceDataBean that represents the standard contract price for the order item, the return result could be the sum of all the order item unit price
or single unit price.
|
static PriceDataBean[] |
getStandardPrices(java.lang.Long[] orderItemIds,
com.ibm.commerce.command.CommandContext cmdCtx,
boolean forSingleUnit)
Gets the standard offer prices for order items.
|
static PriceDataBean[] |
getStandardPrices(java.lang.Long[] catEntryIDs,
QuantityAmount[] quantities,
com.ibm.commerce.command.CommandContext cmdCtx)
Gets a PriceDataBean[] that represent the standard contract prices for the list of items.
|
static PriceDataBean[] |
getStandardPrices(java.lang.Long[] catEntryIDs,
QuantityAmount[] quantities,
com.ibm.commerce.command.CommandContext cmdCtx,
java.lang.String currency)
Gets a PriceDataBean[] that represent the standard contract prices for the list of items.
|
static PriceDataBean[] |
getStandardPrices(java.lang.Long[] catEntryIDs,
QuantityAmount[] quantities,
com.ibm.commerce.command.CommandContext cmdCtx,
java.lang.String currency,
boolean forSingleUnit)
Gets a PriceDataBean[] that represent the standard contract prices for the list of items.
|
public static final java.lang.String COPYRIGHT
public static PriceDataBean getStandardPrice(java.lang.String catEntryID, com.ibm.commerce.command.CommandContext cmdCtx)
catEntryID
- A catalog entry ID stringcmdCtx
- A CommandContext objectPriceDataBean
. Return null if exception encountered.public static PriceDataBean getStandardPrice(java.lang.String orderItemId, com.ibm.commerce.command.CommandContext cmdCtx, boolean forSingleUnit)
orderItemId
- Order Item IdentifiercmdCtx
- Command context instanceforSingleUnit
- Set true if want to return a standard price for a single unit
within this offer, doesn't matter how many in the order. set
false if want to return a sum of standard price for the number
of units.PriceDataBean
represents the standard offer
price.public static PriceDataBean getStandardPrice(java.lang.String catEntryID, com.ibm.commerce.command.CommandContext cmdCtx, java.lang.String currency)
catEntryID
- A catalog entry ID stringcmdCtx
- A CommandContext objectcurrency
- The currency under which to price the catalog entry. If null, the currency in the command context will be used.PriceDataBean
. Return null if exception encountered.public static PriceDataBean getStandardPrice(java.lang.String catEntryID, java.lang.String quantityToUse, com.ibm.commerce.command.CommandContext cmdCtx, java.lang.String currency, boolean forSingleUnit)
getStandardPrice(yourCatEntryID, 3, commandContext, USD, false)
will be $12.00, which is $4 x 3.
The result of call getStandardPrice(yourCatEntryID, 3, commandContext, USD, true)
will be $4.00.
The result of call getStandardPrice(yourCatEntryID, 2, commandContext, USD, false)
will be $10.00, which is $5 x 2.
The result of call getStandardPrice(yourCatEntryID, 2, commandContext, USD, true)
will be $5.00.catEntryID
- A catalog entry ID stringquantityToUse
- the quantity of the unit this order item potentially contains.cmdCtx
- A CommandContext objectcurrency
- The currency under which to price the catalog entry. If null, the currency in the command context will be used.boolean
- set true if want to return a standard price for a single unit within this offer, doesn't matter how many in the order.
set false if want to return a sum of standard price for the number of units. (Number is defined by QuantityAmount
.)PriceDataBean
. Return null if exception encountered.public static PriceDataBean[] getStandardPrices(java.lang.Long[] orderItemIds, com.ibm.commerce.command.CommandContext cmdCtx, boolean forSingleUnit) throws com.ibm.commerce.exception.ECException
orderItemIds
- An array of order item identifierscmdCtx
- Command context instanceforSingleUnit
- Set true if want to return a standard price for a single unit
within this offer, doesn't matter how many in the order. set
false if want to return a sum of standard price for the number
of units.PriceDataBean
represents the standard
offer pricescom.ibm.commerce.exception.ECException
public static PriceDataBean[] getStandardPrices(java.lang.Long[] catEntryIDs, QuantityAmount[] quantities, com.ibm.commerce.command.CommandContext cmdCtx) throws com.ibm.commerce.exception.ECException
catEntryIDs
- An array of catalog entry ID stringsquantities
- An array of QuantityAmount objectscmdCtx
- A CommandContext objectPriceDataBean[]
.com.ibm.commerce.exception.ECException
- An exception occurs during the execution of the method.public static PriceDataBean[] getStandardPrices(java.lang.Long[] catEntryIDs, QuantityAmount[] quantities, com.ibm.commerce.command.CommandContext cmdCtx, java.lang.String currency) throws com.ibm.commerce.exception.ECException
catEntryIDs
- An array of catalog entry ID stringsquantities
- An array of QuantityAmount objectscmdCtx
- A CommandContext objectcurrency
- the currency under which to price. If null, the currency stored in the command context will be used.PriceDataBean[]
.com.ibm.commerce.exception.ECException
- An exception occurs during the execution of the method.public static PriceDataBean[] getStandardPrices(java.lang.Long[] catEntryIDs, QuantityAmount[] quantities, com.ibm.commerce.command.CommandContext cmdCtx, java.lang.String currency, boolean forSingleUnit) throws com.ibm.commerce.exception.ECException
catEntryIDs
- An array of catalog entry ID stringsquantities
- An array of QuantityAmount objectscmdCtx
- A CommandContext objectcurrency
- the currency under which to price. If null, the currency stored in the command context will be used.boolean
- set true if want to return a standard price for a single unit within this offer, doesn't matter how many in the order.
set false if want to return a sum of standard price for the number of units. (Number is defined by QuantityAmount
.)PriceDataBean[]
.com.ibm.commerce.exception.ECException
- An exception occurs during the execution of the method.