public class ConditionalExpression
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EXPRESSION_TYPE_BOOLEAN_EXPRESSION
Expression type: boolean expression.
|
static java.lang.String |
EXPRESSION_TYPE_BOOLEAN_REGEX
Expression type: boolean Regex.
|
| Constructor and Description |
|---|
ConditionalExpression(java.lang.String booleanExpression,
java.util.HashMap<java.lang.String,java.lang.String> variablesMap)
Create a new instance with a boolean expression.
|
ConditionalExpression(java.lang.String regexInput,
java.lang.String regex,
java.util.HashMap<java.lang.String,java.lang.String> variablesMap)
Create a new instance with a boolean Regex.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
compute()
Compute the conditional expression.
|
java.lang.String |
getExpression()
Get the expression (boolean expression or boolean Regex).
|
java.lang.String |
getExpressionType()
Get the expression type.
|
java.lang.String |
getRegexInput()
Get the Regex input.
|
public static final java.lang.String EXPRESSION_TYPE_BOOLEAN_EXPRESSION
ConditionInterpreter,
Constant Field Valuespublic static final java.lang.String EXPRESSION_TYPE_BOOLEAN_REGEX
public ConditionalExpression(java.lang.String booleanExpression,
java.util.HashMap<java.lang.String,java.lang.String> variablesMap)
booleanExpression - the boolean expression, which supports placeholder variablesvariablesMap - a map of variables whose values can replace the values of placeholder variables, key = variable name, value = variable valueEXPRESSION_TYPE_BOOLEAN_EXPRESSIONpublic ConditionalExpression(java.lang.String regexInput,
java.lang.String regex,
java.util.HashMap<java.lang.String,java.lang.String> variablesMap)
regexInput - the input to which the Regex is applied.regex - the Regex itself, which supports placeholder variables. the placeholder variables are replaced first, before the Regex is evaluatedvariablesMap - a map of variables whose values can replace the values of placeholder variables, key = variable name, value = variable valueEXPRESSION_TYPE_BOOLEAN_REGEXpublic boolean compute()
throws java.lang.Exception
java.lang.Exception - if somewhat failspublic java.lang.String getExpressionType()
EXPRESSION_TYPE_BOOLEAN_EXPRESSION,
EXPRESSION_TYPE_BOOLEAN_REGEXpublic java.lang.String getExpression()
public java.lang.String getRegexInput()
throws java.lang.RuntimeException
java.lang.RuntimeException - if the expression type is not EXPRESSION_TYPE_BOOLEAN_REGEXEXPRESSION_TYPE_BOOLEAN_REGEX