com.elasticpath.domain.rules.impl
Class SkuInCartConditionImpl
java.lang.Object
com.elasticpath.domain.impl.AbstractEpDomainImpl
com.elasticpath.domain.impl.AbstractPersistenceImpl
com.elasticpath.domain.impl.AbstractValueObjectImpl
com.elasticpath.domain.rules.impl.AbstractRuleElementImpl
com.elasticpath.domain.rules.impl.SkuInCartConditionImpl
- All Implemented Interfaces:
- EpDomain, Persistence, RuleCondition, RuleElement, ValueObject, java.io.Serializable
public class SkuInCartConditionImpl
- extends AbstractRuleElementImpl
- implements RuleCondition
Rule condition that requires a particular SKU to be in the shopping cart.
- See Also:
- Serialized Form
Method Summary |
boolean |
appliesInScenario(int scenarioId)
Check if this rule element is valid in the specified scenario. |
java.lang.String[] |
getAllowedExceptions()
Return the array of the allowed RuleException types for the rule. |
java.lang.String |
getDisplayText()
Returns the text representation of this condition. |
java.lang.String[] |
getParameterKeys()
Return the array of the required parameter keys for the rule. |
java.lang.String |
getRuleCode()
Returns the Drools code corresponding to this rule condition. |
Methods inherited from class com.elasticpath.domain.rules.impl.AbstractRuleElementImpl |
addParameter, getExceptions, getKind, getParameters, getType, setDefaultValues, setExceptions, setKind, setParameters, setRuleId, setType, validate |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.elasticpath.domain.rules.RuleElement |
addParameter, getExceptions, getKind, getParameters, getType, setExceptions, setKind, setParameters, setRuleId, setType, validate |
serialVersionUID
public static final long serialVersionUID
- Serial version id.
- See Also:
- Constant Field Values
SkuInCartConditionImpl
public SkuInCartConditionImpl()
appliesInScenario
public boolean appliesInScenario(int scenarioId)
- Check if this rule element is valid in the specified scenario.
- Specified by:
appliesInScenario
in interface RuleElement
- Parameters:
scenarioId
- the Id of the scenario to check (defined in RuleScenarios)
- Returns:
- true if the rule element is applicable in the given scenario
getAllowedExceptions
public java.lang.String[] getAllowedExceptions()
- Return the array of the allowed
RuleException
types for the rule.
- Specified by:
getAllowedExceptions
in interface RuleElement
- Returns:
- an array of String of the allowed
RuleException
types for the rule.
getDisplayText
public java.lang.String getDisplayText()
- Returns the text representation of this condition.
- Specified by:
getDisplayText
in interface RuleElement
- Returns:
- the display text
getParameterKeys
public java.lang.String[] getParameterKeys()
- Return the array of the required parameter keys for the rule.
- Specified by:
getParameterKeys
in interface RuleElement
- Returns:
- an array of String of the required parameter keys for the rule.
getRuleCode
public java.lang.String getRuleCode()
throws EpDomainException
- Returns the Drools code corresponding to this rule condition.
- Specified by:
getRuleCode
in interface RuleElement
- Returns:
- the rule code.
- Throws:
EpDomainException
- if the rule is not well formed