Class SingleConditionEvaluator<LHS,​RHS>

  • Type Parameters:
    LHS - Type of the left hand side operand.
    RHS - Type of the right hand side operand.
    All Implemented Interfaces:
    Predicate<ISingleConditionData<LHS,​RHS>>

    public final class SingleConditionEvaluator<LHS,​RHS>
    extends Object
    implements Predicate<ISingleConditionData<LHS,​RHS>>
    Predicate that checks a simple condition.
    Since:
    8.0.0
    Author:
    XIMA Media GmbH
    • Method Detail

      • test

        public boolean test​(ISingleConditionData<LHS,​RHS> data)
        Tests the form condition for the given values and operand.
        Specified by:
        test in interface Predicate<LHS>
        Returns:
        Whether the condition is satisfied or not. false if the operator is not applicable to the operand types.
      • test

        public boolean test​(LHS lhsValue,
                            IMatchCondition operator,
                            RHS rhsValue)
        Tests the form condition for the given values and operand.
        Parameters:
        lhsValue - Left hand side, value to check against the matchOperand.
        operator - Operator indicating how the two values are compared against each other.
        rhsValue - Right hand side, value to check against the valueToCheck.
        Returns:
        Whether the condition is satisfied or not. false if the operator is not applicable to the operand types.
      • create

        public static <LHS,​RHS> SingleConditionEvaluator<LHS,​RHS> create​(Function<LHS,​? extends Object> leftOperandMapper,
                                                                                     Function<RHS,​? extends Object> rightOperandMapper)
        Creates a new form value condition check with the given locale and replacer.
        Type Parameters:
        LHS - Type of the left hand side operand.
        RHS - Type of the right hand side operand.
        Parameters:
        leftOperandMapper - Optional mapper that, if present, is applied to the left hand side operand before it is passed to the operator. Can be used e.g. to replace placeholders in strings.
        rightOperandMapper - Optional mapper that, if present, is applied to the right hand side operand before it is passed to the operator. Can be used e.g. to replace placeholders in strings.
        Returns:
        A new single condition evaluator.
      • create

        public static <T> SingleConditionEvaluator<T,​T> create​(Function<T,​? extends Object> operandMapper)
        Creates a new form value condition check with the given locale and replacer.
        Type Parameters:
        T - Type of the left and right hand side operands.
        Parameters:
        operandMapper - Optional mapper that, if present, is applied to the left and right hand side operand before they are passed to the operator. Can be used e.g. to replace placeholders in strings.
        Returns:
        A new single condition evaluator.