Class PositionExpression<T,​R>

  • Type Parameters:
    T - Input parameter type
    R - Return parameter type
    All Implemented Interfaces:
    java.util.function.Function<T,​java.lang.Integer>, Expression<T,​java.lang.Integer>, ExpressionNode<T,​java.lang.Integer>

    public class PositionExpression<T,​R>
    extends AbstractFunctionExpression<T,​java.lang.Integer>
    POSITION takes a search pattern and a source string as parameters and returns the position of the first occurrence of a pattern in a source string. If the pattern is not found within the source string, this function returns 0. Optionally takes third integer parameter, defining from which position search should be started. Third parameter should be an integer greater than 0. If source string is null, returns zero.
    • Constructor Detail

      • PositionExpression

        public PositionExpression​(java.lang.String alias,
                                  java.util.List<ExpressionNode<T,​?>> args)
        Constructor initializes children expression list
        Parameters:
        alias - Expression alias
        args - List of children expressions
    • Method Detail

      • apply

        public java.lang.Integer apply​(T value)
        Performs position operation using parameters and the value supplied
        Parameters:
        value - Object to handle
        Returns:
        Resulting string