Class BaseSingleFieldConstraint
- java.lang.Object
-
- org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint
-
- All Implemented Interfaces:
HasExpressionConstraint,HasOperator,HasParameterizedOperator
- Direct Known Subclasses:
ConnectiveConstraint,SingleFieldConstraint
public class BaseSingleFieldConstraint extends Object implements HasParameterizedOperator, HasExpressionConstraint
Represents a constraint, which may be part of a direct field constraint or a connective.
-
-
Field Summary
Fields Modifier and Type Field Description protected intconstraintValueTypeprotected ExpressionFormLineexpressionprotected Stringoperatorprotected Map<String,String>parametersstatic intTYPE_ENUMThis is not used yet.static intTYPE_EXPR_BUILDER_VALUEThis is for a "expression builder" that calculates a value.static intTYPE_LITERALThis may be string, or number, anything really.static intTYPE_PREDICATEThe fieldName and fieldBinding is not used in the case of a predicate.static intTYPE_RET_VALUEThis is for a "formula" that calculates a value.static intTYPE_TEMPLATEThis is for a field to be a placeholder for a templatestatic intTYPE_UNDEFINEDThis is used only when constraint is first created.static intTYPE_VARIABLEThis is when it is set to a valid previously bound variable.protected Stringvalue
-
Constructor Summary
Constructors Constructor Description BaseSingleFieldConstraint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearParameters()Clear all parametersvoiddeleteParameter(String key)Delete a parameterbooleanequals(Object o)intgetConstraintValueType()ExpressionFormLinegetExpressionValue()StringgetOperator()Get operatorStringgetParameter(String key)Get a parameterMap<String,String>getParameters()Get all parametersStringgetValue()inthashCode()voidsetConstraintValueType(int constraintValueType)voidsetExpressionValue(ExpressionFormLine expression)voidsetOperator(String operator)Set operatorvoidsetParameter(String key, String parameter)Set a parametervoidsetParameters(Map<String,String> parameters)Set all parametersvoidsetValue(String value)
-
-
-
Field Detail
-
TYPE_UNDEFINED
public static final int TYPE_UNDEFINED
This is used only when constraint is first created. This means that there is no value yet for the constraint.- See Also:
- Constant Field Values
-
TYPE_LITERAL
public static final int TYPE_LITERAL
This may be string, or number, anything really.- See Also:
- Constant Field Values
-
TYPE_VARIABLE
public static final int TYPE_VARIABLE
This is when it is set to a valid previously bound variable.- See Also:
- Constant Field Values
-
TYPE_RET_VALUE
public static final int TYPE_RET_VALUE
This is for a "formula" that calculates a value.- See Also:
- Constant Field Values
-
TYPE_ENUM
public static final int TYPE_ENUM
This is not used yet. ENUMs are not suitable for business rules until we can get data driven non code enums.- See Also:
- Constant Field Values
-
TYPE_PREDICATE
public static final int TYPE_PREDICATE
The fieldName and fieldBinding is not used in the case of a predicate.- See Also:
- Constant Field Values
-
TYPE_EXPR_BUILDER_VALUE
public static final int TYPE_EXPR_BUILDER_VALUE
This is for a "expression builder" that calculates a value.- See Also:
- Constant Field Values
-
TYPE_TEMPLATE
public static final int TYPE_TEMPLATE
This is for a field to be a placeholder for a template- See Also:
- Constant Field Values
-
value
protected String value
-
operator
protected String operator
-
constraintValueType
protected int constraintValueType
-
expression
protected ExpressionFormLine expression
-
-
Method Detail
-
setValue
public void setValue(String value)
-
getValue
public String getValue()
-
setConstraintValueType
public void setConstraintValueType(int constraintValueType)
-
getConstraintValueType
public int getConstraintValueType()
-
getExpressionValue
public ExpressionFormLine getExpressionValue()
- Specified by:
getExpressionValuein interfaceHasExpressionConstraint
-
setExpressionValue
public void setExpressionValue(ExpressionFormLine expression)
- Specified by:
setExpressionValuein interfaceHasExpressionConstraint
-
clearParameters
public void clearParameters()
Description copied from interface:HasParameterizedOperatorClear all parameters- Specified by:
clearParametersin interfaceHasParameterizedOperator
-
getParameter
public String getParameter(String key)
Description copied from interface:HasParameterizedOperatorGet a parameter- Specified by:
getParameterin interfaceHasParameterizedOperator- Returns:
-
setParameter
public void setParameter(String key, String parameter)
Description copied from interface:HasParameterizedOperatorSet a parameter- Specified by:
setParameterin interfaceHasParameterizedOperator
-
deleteParameter
public void deleteParameter(String key)
Description copied from interface:HasParameterizedOperatorDelete a parameter- Specified by:
deleteParameterin interfaceHasParameterizedOperator
-
getParameters
public Map<String,String> getParameters()
Description copied from interface:HasParameterizedOperatorGet all parameters- Specified by:
getParametersin interfaceHasParameterizedOperator- Returns:
-
setParameters
public void setParameters(Map<String,String> parameters)
Description copied from interface:HasParameterizedOperatorSet all parameters- Specified by:
setParametersin interfaceHasParameterizedOperator
-
setOperator
public void setOperator(String operator)
Description copied from interface:HasOperatorSet operator- Specified by:
setOperatorin interfaceHasOperator
-
getOperator
public String getOperator()
Description copied from interface:HasOperatorGet operator- Specified by:
getOperatorin interfaceHasOperator
-
-