Class ComparisonExpression

  • All Implemented Interfaces:
    com.adobe.marketing.mobile.rulesengine.Evaluable

    
    public class ComparisonExpression<A, B>
     implements Evaluable
                        

    ComparisonExpression allows for comparison of two operands and evaluates to a True or False. Comparison operators include LessThan, LessThanOrEqual to, Equal, NotEqual, GreaterThan, GreaterThanOrEqual to, Contains and notContains.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      RulesResult evaluate(Context context) Call this method to evaluate this ComparisonExpression.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ComparisonExpression

        ComparisonExpression(Operand<A> lhs, String operationName, Operand<B> rhs)
        Initializer.
        Parameters:
        lhs - an Operand
        operationName - A String value defining the operation.
        rhs - an Operand
    • Method Detail

      • evaluate

         RulesResult evaluate(Context context)

        Call this method to evaluate this ComparisonExpression.

        This method always returns a valid non null RulesResult object. Returns RulesResult failure if the operation name or either of the operands are null.

        Parameters:
        context - The context containing details for token swapping and transforming the operand if required.
        Returns:

        A RulesResult object representing a evaluated rule