Class BooleanCondition
java.lang.Object
com.aquima.interactions.rule.parser.BooleanCondition
- All Implemented Interfaces:
ICondition
,IExpression
,Serializable
This class represents a direct boolean condition result.
- Since:
- 6.0
- Author:
- F. van der Meer
- See Also:
-
Field Summary
Fields inherited from interface com.aquima.interactions.rule.ICondition
FALSE, TRUE
-
Constructor Summary
ConstructorsConstructorDescriptionBooleanCondition
(boolean result) Constructs the condition class with the fixed result. -
Method Summary
Modifier and TypeMethodDescriptionevaluateConditionWith
(InferenceContext context, BooleanValue unknownValue) Evaluate method that will ensure the result is a boolean value, and use the default value passed if the expression did not yield any result.evaluateWith
(InferenceContext context) This method will evaluate the expression and return the result as a value object.This method will return the expected output data type of the expression.This method return the original (unparsed) expression.String[]
Returns a list of the entity names which could be used as root scope during expression evaluation.boolean
Returns whether the output of the expression is a list.
-
Constructor Details
-
BooleanCondition
public BooleanCondition(boolean result) Constructs the condition class with the fixed result.- Parameters:
result
- The boolean result for the condition.
-
-
Method Details
-
evaluateConditionWith
Description copied from interface:ICondition
Evaluate method that will ensure the result is a boolean value, and use the default value passed if the expression did not yield any result.- Specified by:
evaluateConditionWith
in interfaceICondition
- Parameters:
context
- The context that should be used to evaluate the expression with.unknownValue
- The default value that should be returned when the expression does not yield a result.- Returns:
- Boolean value containing the result of the expression evaluation, or the default value.
-
evaluateWith
Description copied from interface:IExpression
This method will evaluate the expression and return the result as a value object.- Specified by:
evaluateWith
in interfaceIExpression
- Parameters:
context
- object containing the objects that are visible for the expression.- Returns:
- Value object with the result of the expression.
-
getDataType
Description copied from interface:IExpression
This method will return the expected output data type of the expression. Never null but in some cases it can be DataType.ANY if it is unknown.- Specified by:
getDataType
in interfaceIExpression
- Returns:
- DataType
-
getExpression
Description copied from interface:IExpression
This method return the original (unparsed) expression.- Specified by:
getExpression
in interfaceIExpression
- Returns:
- String containing the original expression.
-
getScopeObjects
Description copied from interface:IExpression
Returns a list of the entity names which could be used as root scope during expression evaluation. This does not necessarily mean these scope objects will be used. All returned scope objects are lowercase, since the expression evaluator is case-insensitive it sees them as lowercase.- Specified by:
getScopeObjects
in interfaceIExpression
- Returns:
- Never null
-
isMultivalue
public boolean isMultivalue()Description copied from interface:IExpression
Returns whether the output of the expression is a list.- Specified by:
isMultivalue
in interfaceIExpression
- Returns:
- boolean
-