Class CaseExpression<T,​R>

  • Type Parameters:
    T - Input parameter type
    R - Output parameter type
    All Implemented Interfaces:
    Function<T,​R>, Expression<T,​R>, ExpressionNode<T,​R>

    public class CaseExpression<T,​R>
    extends AbstractExpressionNode<T,​R>
    Conditional CASE operation. It goes through conditions and returns a value when the first condition is met (like an if-then-else statement). So, once a condition is true, it will stop reading and return the result. If no conditions are true, it returns the value in the ELSE clause.
    • Constructor Detail

      • CaseExpression

        public CaseExpression​(List<ExpressionNode<T,​R>> conditions,
                              List<ExpressionNode<T,​R>> outcomes)
        Constructor initializes children expression list
        Parameters:
        conditions - List of condition expressions
        outcomes - List of outcome expressions
    • Method Detail

      • apply

        public R apply​(T value)
        Performs CASE operation using parameters and the value supplied
        Parameters:
        value - Object to handle
        Returns:
        Boolean result of value evaluation