com.elasticpath.domain.rules.impl
Class PromotionRuleExceptionsImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractPersistenceImpl
          extended by com.elasticpath.domain.impl.AbstractValueObjectImpl
              extended by com.elasticpath.domain.rules.impl.PromotionRuleExceptionsImpl
All Implemented Interfaces:
EpDomain, Persistence, PromotionRuleExceptions, ValueObject, java.io.Serializable

public class PromotionRuleExceptionsImpl
extends AbstractValueObjectImpl
implements PromotionRuleExceptions

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. Note that objects of this class are instantiated by Drools and therefore can't be created through Spring.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Fields inherited from interface com.elasticpath.domain.rules.PromotionRuleExceptions
CATEGORY_IDS, EXCEPTION_STRING_SEPARATOR, PRODUCR_IDS, PRODUCTSKU_CODES
 
Constructor Summary
PromotionRuleExceptionsImpl()
           
 
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 or category 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 class com.elasticpath.domain.impl.AbstractPersistenceImpl
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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

serialVersionUID

public static final long serialVersionUID
Serial version id.

See Also:
Constant Field Values
Constructor Detail

PromotionRuleExceptionsImpl

public PromotionRuleExceptionsImpl()
Method Detail

isCategoryExcluded

public 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.

Specified by:
isCategoryExcluded in interface PromotionRuleExceptions
Parameters:
category - the category to check
Returns:
true if the category has been specified as an exception

isProductExcluded

public 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.

Specified by:
isProductExcluded in interface PromotionRuleExceptions
Parameters:
product - the product to check
Returns:
true if the product has been specified as an exception

isSkuExcluded

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

Specified by:
isSkuExcluded in interface PromotionRuleExceptions
Parameters:
productSku - the sku to check
Returns:
true if the sku has been specified as an exception

populateFromExceptionStr

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

Specified by:
populateFromExceptionStr in interface PromotionRuleExceptions
Parameters:
exceptionStr - - the string representation of a list of RuleExceptions.
Throws:
EpDomainException - if an invalid exception string is passed in.