Interface TextFunctionExpression<T>
- Type Parameters:
T- entity type.
- All Superinterfaces:
ComparableExpression<T,,String> Expression<T,,String> 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the function that computes the concatenation of theStringvalues to which two textual expressions evaluate.static final StringName of the function that computes the beginning (leftmost) characters of theStringvalue to which a textual expression evaluates.static final StringName of the function that computes the lower case form of theStringvalue to which a textual expression evaluates.static final StringName of the function that computes the ending (rightmost) characters of theStringvalue to which a textual expression evaluates.static final StringName of the function that computes the upper case form of theStringvalue to which a textual expression evaluates. -
Method Summary
Modifier and TypeMethodDescriptionList<? extends ComparableExpression<? super T, ?>> An ordered list of inputs to the function.static <T> TextFunctionExpression<T> of(String name, TextExpression<? super T> expression) Creates aTextFunctionExpressionto represent a function with the givennamethat accepts the given textualexpressionas input.static <T> TextFunctionExpression<T> of(String name, TextExpression<? super T> expression, int literal) Creates aTextFunctionExpressionto represent a function with the givennamethat accepts a textualexpressionand a numeric (literal) as input.static <T> TextFunctionExpression<T> of(String name, TextExpression<? super T> left, TextExpression<? super T> right) Creates aTextFunctionExpressionto represent a function with the givennamethat accepts textual expressions (leftandright) as input.static <T> TextFunctionExpression<T> of(String name, TextExpression<? super T> left, String right) Creates aTextFunctionExpressionto represent a function with the givennamethat accepts a textual expression (left) and aStringvalue (right) as input.static <T> TextFunctionExpression<T> of(String name, String left, TextExpression<? super T> right) Creates aTextFunctionExpressionto represent a function with the givennamethat accepts aStringvalue (left) and a textual expression (right) as input.Methods inherited from interface jakarta.data.expression.ComparableExpression
between, between, greaterThan, greaterThan, greaterThanEqual, greaterThanEqual, lessThan, lessThan, lessThanEqual, lessThanEqual, notBetween, notBetweenMethods inherited from interface jakarta.data.expression.Expression
equalTo, equalTo, in, in, in, isNull, notEqualTo, notEqualTo, notIn, notIn, notIn, notNull, satisfiesMethods inherited from interface jakarta.data.spi.expression.function.FunctionExpression
nameMethods inherited from interface jakarta.data.expression.TextExpression
append, append, contains, endsWith, left, length, like, like, like, like, lower, notContains, notEndsWith, notLike, notLike, notLike, notStartsWith, prepend, prepend, right, startsWith, type, upper
-
Field Details
-
CONCAT
Name of the function that computes the concatenation of the
Stringvalues to which two textual expressions evaluate.This function accepts two textual expressions as its arguments:
- The first argument is a textual expression that evaluates to a
Stringvalue that becomes the first part of the concatenated text. - The second argument is a textual expression that evaluates to a
Stringvalue that becomes the second part of the concatenated text.
The result of the
CONCATfunction 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:
- The first argument is a textual expression that evaluates to a
-
LEFT
Name of the function that computes the beginning (leftmost) characters of the
Stringvalue to which a textual expression evaluates.This function accepts two arguments:
- The first argument is a textual expression that evaluates to a
Stringvalue. - The second argument is a
NumericLiteralthat evaluates to theintvalue indicating the number of characters to obtain from the beginning of theString.
The result of the
LEFTfunction is a textual expression with the same entity type as the arguments. The result represents theStringformed by copying a given length of characters from the beginning of theStringto which the first expression argument evaluates.- See Also:
- The first argument is a textual expression that evaluates to a
-
RIGHT
Name of the function that computes the ending (rightmost) characters of the
Stringvalue to which a textual expression evaluates.This function accepts two arguments:
- The first argument is a textual expression that evaluates to a
Stringvalue. - The second argument is a
NumericLiteralthat evaluates to theintvalue indicating the number of characters to obtain from the end of theString.
The result of the
RIGHTfunction is a textual expression with the same entity type as the arguments. The result represents theStringformed by copying a given length of characters from the end of theStringto which the first expression argument evaluates.- See Also:
- The first argument is a textual expression that evaluates to a
-
LOWER
Name of the function that computes the lower case form of the
Stringvalue to which a textual expression evaluates.This function accepts a textual expression as its only argument.
The result of the
LOWERfunction is a textual expression with the same entity type as the argument. The result represents the lower case form of theStringvalue to which the expression argument evaluates.- See Also:
-
UPPER
Name of the function that computes the upper case form of the
Stringvalue to which a textual expression evaluates.This function accepts a textual expression as its only argument.
The result of the
UPPERfunction is a textual expression with the same entity type as the argument. The result represents the upper case form of theStringvalue to which the expression argument evaluates.- See Also:
-
-
Method Details
-
of
Creates aTextFunctionExpressionto represent a function with the givennamethat accepts the given textualexpressionas input.- Type Parameters:
T- entity type.- Parameters:
name- a function name constant (such asLOWER) 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 aStringvalue.- Returns:
- a
TextFunctionExpressionrepresenting the function.
-
of
Creates aTextFunctionExpressionto represent a function with the givennamethat accepts a textual expression (left) and aStringvalue (right) as input.- Type Parameters:
T- entity type.- Parameters:
name- a function name constant (such asCONCAT) 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 aStringvalue.right- the function's second argument.- Returns:
- a
TextFunctionExpressionrepresenting the function.
-
of
Creates aTextFunctionExpressionto represent a function with the givennamethat accepts aStringvalue (left) and a textual expression (right) as input.- Type Parameters:
T- entity type.- Parameters:
name- a function name constant (such asCONCAT) 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 aStringvalue.- Returns:
- a
TextFunctionExpressionrepresenting the function.
-
of
static <T> TextFunctionExpression<T> of(String name, TextExpression<? super T> left, TextExpression<? super T> right) Creates aTextFunctionExpressionto represent a function with the givennamethat accepts textual expressions (leftandright) as input.- Type Parameters:
T- entity type.- Parameters:
name- a function name constant (such asCONCAT) 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 aStringvalue.right- the function's first argument, in the form of an expression that evaluates to aStringvalue.- Returns:
- a
TextFunctionExpressionrepresenting the function.
-
of
static <T> TextFunctionExpression<T> of(String name, TextExpression<? super T> expression, int literal) Creates aTextFunctionExpressionto represent a function with the givennamethat accepts a textualexpressionand a numeric (literal) as input.- Type Parameters:
T- entity type.- Parameters:
name- a function name constant (such asLEFT) 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 aStringvalue.literal- the function's second argument, in the form of a numeric value.- Returns:
- a
TextFunctionExpressionrepresenting the function.
-
arguments
List<? extends ComparableExpression<? super T,?>> arguments()An ordered list of inputs to the function.
A constant (such as
CONCATorLEFTdefined 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 anExpressionsubtype represents invocation of a function on a target expression, such asTextExpression.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:
argumentsin interfaceFunctionExpression<T,String> - Returns:
- a list of expressions that represent the arguments to the function.
-