com.elasticpath.domain.rules
Interface PromotionRuleExceptions

All Superinterfaces:
EpDomain, Persistence, java.io.Serializable, ValueObject
All Known Implementing Classes:
PromotionRuleExceptionsImpl

public interface PromotionRuleExceptions
extends ValueObject

This class holds exceptions to a rule, i.e. a map of sku codes and product categories that will be excluded from a particular action. This class is passed to the PromotionRuleDelegate's action methods.


Field Summary
static java.lang.String CATEGORY_IDS
          Category UIDs.
static char EXCEPTION_STRING_SEPARATOR
          Exception String Separator.
static java.lang.String PRODUCR_IDS
          Product UID.
static java.lang.String PRODUCTSKU_CODES
          Product SKU codes.
 
Method Summary
 boolean isCategoryExcluded(Category category)
          Returns true if the specified category is a rule exception because it's category id has been specified as an exception.
 boolean isProductExcluded(Product product)
          Returns true if the specified product is a rule exception because it's product id or category id has been specified as an exception.
 boolean isSkuExcluded(ProductSku productSku)
          Returns true if the specified sku is a rule exception because it's sku code, product id or category id has been specified as an exception.
 void populateFromExceptionStr(java.lang.String exceptionStr)
          Return the instance of PromotionRuleExceptions from parsing the given string representation.
 
Methods inherited from interface com.elasticpath.domain.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Field Detail

CATEGORY_IDS

static final java.lang.String CATEGORY_IDS
Category UIDs.

See Also:
Constant Field Values

EXCEPTION_STRING_SEPARATOR

static final char EXCEPTION_STRING_SEPARATOR
Exception String Separator.

See Also:
Constant Field Values

PRODUCR_IDS

static final java.lang.String PRODUCR_IDS
Product UID.

See Also:
Constant Field Values

PRODUCTSKU_CODES

static final java.lang.String PRODUCTSKU_CODES
Product SKU codes.

See Also:
Constant Field Values
Method Detail

isCategoryExcluded

boolean isCategoryExcluded(Category category)
Returns true if the specified category is a rule exception because it's category id has been specified as an exception.

Parameters:
category - the category to check
Returns:
true if the category has been specified as an exception

isProductExcluded

boolean isProductExcluded(Product product)
Returns true if the specified product is a rule exception because it's product id or category id has been specified as an exception.

Parameters:
product - the product to check
Returns:
true if the product has been specified as an exception

isSkuExcluded

boolean isSkuExcluded(ProductSku productSku)
Returns true if the specified sku is a rule exception because it's sku code, product id or category id has been specified as an exception.

Parameters:
productSku - the sku to check
Returns:
true if the sku has been specified as an exception

populateFromExceptionStr

void populateFromExceptionStr(java.lang.String exceptionStr)
                              throws EpDomainException
Return the instance of PromotionRuleExceptions from parsing the given string representation.

Parameters:
exceptionStr - - the string representation of a list of RuleExceptions.\
Throws:
EpDomainException - if an invalid exception string is passed in.