com.elasticpath.domain.rules.impl
Class PromotionRuleImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractPersistenceImpl
          extended by com.elasticpath.domain.impl.AbstractEntityImpl
              extended by com.elasticpath.domain.rules.impl.AbstractRuleImpl
                  extended by com.elasticpath.domain.rules.impl.PromotionRuleImpl
All Implemented Interfaces:
Entity, EpDomain, Persistence, Rule, java.io.Serializable

public class PromotionRuleImpl
extends AbstractRuleImpl

Represents a rules engine rule that involves product promotions. Conditions and actions of promotion rules will have the following objects available: -delegate -cart -product

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Fields inherited from interface com.elasticpath.domain.rules.Rule
AND_OPERATOR, OR_OPERATOR
 
Constructor Summary
PromotionRuleImpl()
           
 
Method Summary
 java.lang.String getPromoCode()
          Get the promoCode of this rule.
 java.lang.String getRuleCode()
          Returns the Drools code corresponding to this rule.
 boolean isSingleUse()
          True if this promoCode is only for single use.
 void setPromoCode(java.lang.String promoCode)
          Set the promoCode of the rule.
 void setSingleUse(boolean singleUse)
          Sets whether this promoCode is for single use.
 
Methods inherited from class com.elasticpath.domain.rules.impl.AbstractRuleImpl
addAction, addCondition, addEligibility, getActions, getConditionOperator, getConditions, getEligibilities, getEligibilityOperator, getEndDate, getName, getRuleSet, getStartDate, setActions, setConditionOperator, setConditions, setDefaultValues, setEligibilities, setEligibilityOperator, setEndDate, setName, setRuleSet, setStartDate, validate
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEntityImpl
convertAttributeGroupAttributes, getGuid, setGuid
 
Methods inherited from class com.elasticpath.domain.impl.AbstractPersistenceImpl
executeBeforePersistAction, getUidPk, isPersistent, 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.Entity
getGuid, setGuid
 
Methods inherited from interface com.elasticpath.domain.Persistence
executeBeforePersistAction, getUidPk, isPersistent, 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

PromotionRuleImpl

public PromotionRuleImpl()
Method Detail

getPromoCode

public java.lang.String getPromoCode()
Get the promoCode of this rule.

Returns:
the promoCode of the rule

getRuleCode

public java.lang.String getRuleCode()
                             throws EpDomainException
Returns the Drools code corresponding to this rule.

Specified by:
getRuleCode in interface Rule
Specified by:
getRuleCode in class AbstractRuleImpl
Returns:
the rule code.
Throws:
EpDomainException - if the rule is not well formed

isSingleUse

public boolean isSingleUse()
True if this promoCode is only for single use.

Returns:
True if this promoCode is only for single use.

setPromoCode

public void setPromoCode(java.lang.String promoCode)
Set the promoCode of the rule.

Parameters:
promoCode - the promoCode of the rule

setSingleUse

public void setSingleUse(boolean singleUse)
Sets whether this promoCode is for single use.

Parameters:
singleUse - set to True if this promoCode is only for single use.