Module jakarta.data

Interface TextFunctionExpression<T>

Type Parameters:
T - entity type.
All Superinterfaces:
ComparableExpression<T,String>, Expression<T,String>, FunctionExpression<T,String>, TextExpression<T>

public interface TextFunctionExpression<T> extends FunctionExpression<T,String>, TextExpression<T>

An expression that represents applying a function to one or more expressions that are supplied as arguments() to compute a String result.

  • Field Details

    • CONCAT

      static final String CONCAT

      Name of the function that computes the concatenation of the String values to which two textual expressions evaluate.

      This function accepts two textual expressions as its arguments:

      1. The first argument is a textual expression that evaluates to a String value that becomes the first part of the concatenated text.
      2. The second argument is a textual expression that evaluates to a String value that becomes the second part of the concatenated text.

      The result of the CONCAT function is a textual expression with the same entity type as the arguments. The result represents the concatenation of the values to which the first and second expression arguments evaluate.

      See Also:
    • LEFT

      static final String LEFT

      Name of the function that computes the beginning (leftmost) characters of the String value to which a textual expression evaluates.

      This function accepts two arguments:

      1. The first argument is a textual expression that evaluates to a String value.
      2. The second argument is a NumericLiteral that evaluates to the int value indicating the number of characters to obtain from the beginning of the String.

      The result of the LEFT function is a textual expression with the same entity type as the arguments. The result represents the String formed by copying a given length of characters from the beginning of the String to which the first expression argument evaluates.

      See Also:
    • LOWER

      static final String LOWER

      Name of the function that computes the lower case form of the String value to which a textual expression evaluates.

      This function accepts a textual expression as its only argument.

      The result of the LOWER function is a textual expression with the same entity type as the argument. The result represents the lower case form of the String value to which the expression argument evaluates.

      See Also:
    • UPPER

      static final String UPPER

      Name of the function that computes the upper case form of the String value to which a textual expression evaluates.

      This function accepts a textual expression as its only argument.

      The result of the UPPER function is a textual expression with the same entity type as the argument. The result represents the upper case form of the String value to which the expression argument evaluates.

      See Also:
  • Method Details

    • of

      static <T> TextFunctionExpression<T> of(String name, TextExpression<? super T> expression)
      Creates a TextFunctionExpression to represent a function with the given name that accepts the given textual expression as input.
      Type Parameters:
      T - entity type.
      Parameters:
      name - a function name constant (such as LOWER) defined in this class or a function name constant from a vendor extension.
      expression - the only function argument, in the form of an expression that evaluates to a String value.
      Returns:
      a TextFunctionExpression representing the function.
    • of

      static <T> TextFunctionExpression<T> of(String name, TextExpression<? super T> left, String right)
      Creates a TextFunctionExpression to represent a function with the given name that accepts a textual expression (left) and a String value (right) as input.
      Type Parameters:
      T - entity type.
      Parameters:
      name - a function name constant (such as CONCAT) defined in this class or a function name constant from a vendor extension.
      left - the function's first argument, in the form of an expression that evaluates to a String value.
      right - the function's second argument.
      Returns:
      a TextFunctionExpression representing the function.
    • of

      static <T> TextFunctionExpression<T> of(String name, String left, TextExpression<? super T> right)
      Creates a TextFunctionExpression to represent a function with the given name that accepts a String value (left) and a textual expression (right) as input.
      Type Parameters:
      T - entity type.
      Parameters:
      name - a function name constant (such as CONCAT) defined in this class or a function name constant from a vendor extension.
      left - the function's first argument.
      right - the function's second argument, in the form of an expression that evaluates to a String value.
      Returns:
      a TextFunctionExpression representing the function.
    • of

      static <T> TextFunctionExpression<T> of(String name, TextExpression<? super T> left, TextExpression<? super T> right)
      Creates a TextFunctionExpression to represent a function with the given name that accepts textual expressions (left and right) as input.
      Type Parameters:
      T - entity type.
      Parameters:
      name - a function name constant (such as CONCAT) defined in this class or a function name constant from a vendor extension.
      left - the function's second argument, in the form of an expression that evaluates to a String value.
      right - the function's first argument, in the form of an expression that evaluates to a String value.
      Returns:
      a TextFunctionExpression representing the function.
    • of

      static <T> TextFunctionExpression<T> of(String name, TextExpression<? super T> expression, int literal)
      Creates a TextFunctionExpression to represent a function with the given name that accepts a textual expression and a numeric (literal) as input.
      Type Parameters:
      T - entity type.
      Parameters:
      name - a function name constant (such as LEFT) defined in this class or a function name constant from a vendor extension.
      expression - the function's first argument, in the form of an expression that evaluates to a String value.
      literal - the function's second argument, in the form of a numeric value.
      Returns:
      a TextFunctionExpression representing the function.
    • arguments

      List<? extends ComparableExpression<? super T,?>> arguments()

      An ordered list of inputs to the function.

      A constant (such as CONCAT or LEFT defined in this class or in a vendor extension) defines the function name and is also responsible for documenting the function arguments, including the meaning and data type of each argument and the order in which arguments must be supplied. By convention, when a method of an Expression subtype represents invocation of a function on a target expression, such as TextExpression.left(int), the first element of the argument list should be the target expression, and subsequent elements should be the method arguments, in the same order, if present.

      Specified by:
      arguments in interface FunctionExpression<T,String>
      Returns:
      a list of expressions that represent the arguments to the function.