com.elasticpath.domain.rules.impl
Class PromotionRuleExceptionsImpl
java.lang.Object
com.elasticpath.domain.impl.AbstractEpDomainImpl
com.elasticpath.domain.impl.AbstractPersistenceImpl
com.elasticpath.domain.impl.AbstractValueObjectImpl
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
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 java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
public static final long serialVersionUID
- Serial version id.
- See Also:
- Constant Field Values
PromotionRuleExceptionsImpl
public PromotionRuleExceptionsImpl()
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 RuleException
s.
- Throws:
EpDomainException
- if an invalid exception string is passed in.