Class BooleanCondition

java.lang.Object
com.aquima.interactions.rule.parser.BooleanCondition
All Implemented Interfaces:
ICondition, IExpression, Serializable

public class BooleanCondition extends Object implements ICondition
This class represents a direct boolean condition result.
Since:
6.0
Author:
F. van der Meer
See Also:
  • 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

      public BooleanValue evaluateConditionWith(InferenceContext context, BooleanValue unknownValue)
      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 interface ICondition
      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

      public IValue evaluateWith(InferenceContext context)
      Description copied from interface: IExpression
      This method will evaluate the expression and return the result as a value object.
      Specified by:
      evaluateWith in interface IExpression
      Parameters:
      context - object containing the objects that are visible for the expression.
      Returns:
      Value object with the result of the expression.
    • getDataType

      public DataType 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 interface IExpression
      Returns:
      DataType
    • getExpression

      public String getExpression()
      Description copied from interface: IExpression
      This method return the original (unparsed) expression.
      Specified by:
      getExpression in interface IExpression
      Returns:
      String containing the original expression.
    • getScopeObjects

      public String[] 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 interface IExpression
      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 interface IExpression
      Returns:
      boolean