Package com.sap.cds.ql
Interface Value<T>
- All Superinterfaces:
CqnToken
,CqnValue
,JSONizable
,Orderable
- All Known Subinterfaces:
BooleanValue
,ElementRef<T>
,FunctionCall<T>
,Literal<T>
,NullValue
,Parameter<T>
-
Method Summary
Modifier and TypeMethodDescriptionaverage()
Creates a function by passing this value as a parameter to the underlying data store's AVG function.Creates a between predicate that tests if this value is within a closed interval with given boundsCreates a between predicate that tests if this value is within a closed interval with given boundsCreates a between predicate that tests if this value is within a closed interval with given boundsCreates a between predicate that tests if this value is within a closed interval with given boundsCreates a predicate that tests whether this string value contains a given substringCreates a predicate that tests whether this string value contains a given substringCreates a predicate that tests whether this string value contains a given substringCreates a function by passing this value as a parameter with the DISTINCT keyword to the underlying data store's COUNT function.Creates an expression that divides this numeric value by a given divisorCreates an expression that divides this numeric value by a given divisorCreates a predicate that tests whether this string value ends with a given suffixCreates a predicate that tests whether this string value ends with a given suffixCreates a comparison predicate that tests if this value is equal to a given value.Creates a comparison predicate that tests if this value is equal to a given value.Creates a predicate that applies a given function to this values and optional additional valuesCreates a comparison predicate that tests if this value is greater than or equal to a given valueCreates a comparison predicate that tests if this value is greater than or equal to a given valueCreates a comparison predicate that tests if this value is greater than a given valueCreates a comparison predicate that tests if this value is greater than a given valueCreates an IN predicate that tests if this value is equal to any value in a given listCreates an IN predicate that tests if this value is equal to any value in a given listCreates an IN predicate that tests if this value is equal to any value in a given listCreates an IN predicate that tests if this value is equal to any value in a given listCreates a comparison predicate that tests if this value is equal to a given value.Creates a comparison predicate that tests if this value is equal to a given value.Creates a comparison predicate that tests if this value is not equal to a given value.Creates a comparison predicate that tests if this value is not equal to a given value.Creates a predicate that tests if this value is not NULLisNull()
Creates a predicate that tests if this value is NULLCreates a comparison predicate that tests if this value is less than or equal to a given valueCreates a comparison predicate that tests if this value is less than or equal to a given valueCreates a comparison predicate that tests if this value is less than a given valueCreates a comparison predicate that tests if this value is less than a given valuematchesPattern
(Value<String> pattern) Creates a predicate that tests if this value matches a specified regular expressionmatchesPattern
(Value<String> pattern, boolean caseInsensitive, boolean multiLineSensitive) Creates a predicate that tests if this value matches a specified regular expressionmatchesPattern
(Value<String> pattern, Value<String> options) Creates a predicate that tests if this value matches a specified regular expressionmatchesPattern
(String pattern) Creates a predicate that tests if this value matches a specified regular expressionmax()
Creates a function by passing this value as a parameter to the underlying data store's MAX function.min()
Creates a function by passing this value as a parameter to the underlying data store's MIN function.Creates an expression that subtracts a given subtrahend from this numeric valueCreates an expression that subtracts a given subtrahend from this numeric valueCreates a comparison predicate that tests if this value is not equal to a given value.Creates a comparison predicate that tests if this value is not equal to a given value.Creates an expression that adds a given summand to this numeric valueCreates an expression that adds a given summand to this numeric valuestartsWith
(Value<String> prefix) Creates a predicate that tests whether this string value starts with a given prefixstartsWith
(String prefix) Creates a predicate that tests whether this string value starts with a given prefixsubstring
(int start) Creates an expression for substring extraction from this string value.substring
(int start, int length) Creates an expression for substring extraction from this string value.Creates an expression for substring extraction from this string value.Creates an expression for substring extraction from this value.sum()
Creates a function by passing this value as a parameter to the underlying data store's SUM function.Creates an expression that multiplies this numeric value with a given factorCreates an expression that multiplies this numeric value with a given factortoLower()
Creates an expression for converting this string value to lower case using the rules of the underlying data store.toUpper()
Creates an expression for converting this string value to upper case using the rules of the underlying data store.<U> Value<U>
type
(CdsBaseType cdsType) Sets the type.<U> Value<U>
Sets the type.<U> Value<U>
Sets the type.Methods inherited from interface com.sap.cds.ql.cqn.CqnValue
as, asExpression, asFunction, asList, asLiteral, asNullValue, asParameter, asPlain, asRef, isExpression, isFunction, isList, isLiteral, isNullValue, isParameter, isPlain, isRef, ofLiteral, ofRef, type
Methods inherited from interface com.sap.cds.JSONizable
toJson
Methods inherited from interface com.sap.cds.ql.Orderable
asc, ascNullsLast, desc, descNullsFirst
-
Method Details
-
plus
Creates an expression that adds a given summand to this numeric value- Parameters:
s
- the summand- Returns:
- expression for the addition
-
plus
Creates an expression that adds a given summand to this numeric value- Parameters:
s
- the summand- Returns:
- expression for the addition
-
minus
Creates an expression that subtracts a given subtrahend from this numeric value- Parameters:
s
- the subtrahend- Returns:
- expression for the subtraction
-
minus
Creates an expression that subtracts a given subtrahend from this numeric value- Parameters:
s
- the subtrahend- Returns:
- expression for the subtraction
-
times
Creates an expression that multiplies this numeric value with a given factor- Parameters:
f
- the factor- Returns:
- expression for the multiplication
-
times
Creates an expression that multiplies this numeric value with a given factor- Parameters:
f
- the factor- Returns:
- expression for the multiplication
-
dividedBy
Creates an expression that divides this numeric value by a given divisor- Parameters:
d
- the divisor- Returns:
- expression for the division
-
dividedBy
Creates an expression that divides this numeric value by a given divisor- Parameters:
d
- the divisor- Returns:
- expression for the division
-
substring
Creates an expression for substring extraction from this value. Extracts a substring of given length starting at a specified position. First position is 0.- Parameters:
start
- the start positionlength
- the number of characters that you want to extract- Returns:
- expression for substring extraction
-
substring
Creates an expression for substring extraction from this string value. Extracts a substring of given length starting at a specified position. First position is 0.- Parameters:
start
- the start positionlength
- the number of characters that you want to extract- Returns:
- expression for substring extraction
-
substring
Creates an expression for substring extraction from this string value. Extracts a substring starting at a specified position extending to the end of the string. First position is 0.- Parameters:
start
- the start position- Returns:
- the expression for substring extraction
-
substring
Creates an expression for substring extraction from this string value. Extracts a substring starting at a specified position extending to the end of the string. First position is 0.- Parameters:
start
- the start position- Returns:
- the expression for substring extraction
-
toUpper
Creates an expression for converting this string value to upper case using the rules of the underlying data store.- Returns:
- the String value in UpperCase
-
toLower
Creates an expression for converting this string value to lower case using the rules of the underlying data store.- Returns:
- the String value in LowerCase
-
min
Creates a function by passing this value as a parameter to the underlying data store's MIN function.- Returns:
- the minimum value
-
max
Creates a function by passing this value as a parameter to the underlying data store's MAX function.- Returns:
- the maximum value
-
sum
Creates a function by passing this value as a parameter to the underlying data store's SUM function.- Returns:
- the summation number value
-
average
Creates a function by passing this value as a parameter to the underlying data store's AVG function.- Returns:
- the average number value
-
countDistinct
Creates a function by passing this value as a parameter with the DISTINCT keyword to the underlying data store's COUNT function.- Returns:
- the countDistinct long value
-
isNull
Predicate isNull()Creates a predicate that tests if this value is NULL- Returns:
- the predicate for the NULL test
-
isNotNull
Predicate isNotNull()Creates a predicate that tests if this value is not NULL- Returns:
- the predicate for the not NULL test
-
eq
Creates a comparison predicate that tests if this value is equal to a given value. Depending on the underlying datastore, NULL values might be treated as unknown resulting in a three-valued logic as in SQL.- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
eq
Creates a comparison predicate that tests if this value is equal to a given value. Depending on the underlying datastore, NULL values might be treated as unknown resulting in a three-valued logic as in SQL.- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
ne
Creates a comparison predicate that tests if this value is not equal to a given value. Depending on the underlying datastore, NULL values might be treated as unknown resulting in a three-valued logic as in SQL.- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
ne
Creates a comparison predicate that tests if this value is not equal to a given value. Depending on the underlying datastore, NULL values might be treated as unknown resulting in a three-valued logic as in SQL.- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
is
Creates a comparison predicate that tests if this value is equal to a given value. NULL values are treated as any other value.- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
is
Creates a comparison predicate that tests if this value is equal to a given value. NULL values are treated as any other value.- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
isNot
Creates a comparison predicate that tests if this value is not equal to a given value. NULL values are treated as any other value.- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
isNot
Creates a comparison predicate that tests if this value is not equal to a given value. NULL values are treated as any other value.- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
gt
Creates a comparison predicate that tests if this value is greater than a given value- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
gt
Creates a comparison predicate that tests if this value is greater than a given value- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
ge
Creates a comparison predicate that tests if this value is greater than or equal to a given value- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
ge
Creates a comparison predicate that tests if this value is greater than or equal to a given value- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
lt
Creates a comparison predicate that tests if this value is less than a given value- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
lt
Creates a comparison predicate that tests if this value is less than a given value- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
le
Creates a comparison predicate that tests if this value is less than or equal to a given value- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
le
Creates a comparison predicate that tests if this value is less than or equal to a given value- Parameters:
v
- the value to compare with- Returns:
- the comparison predicate
-
between
Creates a between predicate that tests if this value is within a closed interval with given bounds- Parameters:
low
- the lower boundhigh
- the upper bound- Returns:
- the between predicate
-
between
Creates a between predicate that tests if this value is within a closed interval with given bounds- Parameters:
low
- the lower boundhigh
- the upper bound- Returns:
- the between predicate
-
between
Creates a between predicate that tests if this value is within a closed interval with given bounds- Parameters:
low
- the lower boundhigh
- the upper bound- Returns:
- the between predicate
-
between
Creates a between predicate that tests if this value is within a closed interval with given bounds- Parameters:
low
- the lower boundhigh
- the upper bound- Returns:
- the between predicate
-
in
Creates an IN predicate that tests if this value is equal to any value in a given list- Parameters:
vs
- the given values- Returns:
- the IN predicate for the in list test
-
in
Creates an IN predicate that tests if this value is equal to any value in a given list- Parameters:
ts
- the given values- Returns:
- the IN predicate for the in list test
-
in
Creates an IN predicate that tests if this value is equal to any value in a given list- Parameters:
ts
- the given values- Returns:
- the IN predicate for the in list test
-
in
Creates an IN predicate that tests if this value is equal to any value in a given list- Parameters:
ts
- the given values- Returns:
- the IN predicate for the in list test
-
plain
-
func
Creates a predicate that applies a given function to this values and optional additional values- Parameters:
functionName
- the function nameadditional
- the additional values- Returns:
- the function call
-
contains
Creates a predicate that tests whether this string value contains a given substring- Parameters:
substring
- the substring- Returns:
- the predicate for the containment test
-
contains
Creates a predicate that tests whether this string value contains a given substring- Parameters:
substring
- the substring- Returns:
- the predicate for the containment test
-
contains
Creates a predicate that tests whether this string value contains a given substring- Parameters:
substring
- the substringcaseInsensitive
- whether the test should be case insensitive- Returns:
- the predicate for the containment test
-
startsWith
Creates a predicate that tests whether this string value starts with a given prefix- Parameters:
prefix
- the prefix- Returns:
- the predicate for the starts-with test
-
startsWith
Creates a predicate that tests whether this string value starts with a given prefix- Parameters:
prefix
- the prefix- Returns:
- the predicate for the starts-with test
-
endsWith
Creates a predicate that tests whether this string value ends with a given suffix- Parameters:
suffix
- the suffix- Returns:
- the predicate for the ends-with test
-
endsWith
Creates a predicate that tests whether this string value ends with a given suffix- Parameters:
suffix
- the suffix- Returns:
- the predicate for the ends-with test
-
as
-
withoutAlias
CqnSelectListValue withoutAlias() -
type
Sets the type.- Parameters:
javaType
- the Java type- Returns:
- a value with the given type. Can be a new value if this value is immutable
-
type
Sets the type.- Parameters:
cdsType
- the CDS type- Returns:
- a value with the given type. Can be a new value if this value is immutable
-
type
Sets the type.- Parameters:
cdsType
- the CDS type name- Returns:
- a value with the given type. Can be a new value if this value is immutable
-
matchesPattern
Creates a predicate that tests if this value matches a specified regular expression- Parameters:
pattern
- regular expression represented as a string value- Returns:
- the predicate to match the expression
-
matchesPattern
Creates a predicate that tests if this value matches a specified regular expression- Parameters:
pattern
- regular expression represented as a plain string- Returns:
- the predicate to match the expression
-
matchesPattern
Creates a predicate that tests if this value matches a specified regular expression- Parameters:
pattern
- regular expression represented as a string valueoptions
- regular expression options represented as a string value- Returns:
- the predicate to match the expression
-
matchesPattern
Predicate matchesPattern(Value<String> pattern, boolean caseInsensitive, boolean multiLineSensitive) Creates a predicate that tests if this value matches a specified regular expression- Parameters:
pattern
- regular expression represented as a string valuecaseInsensitive
- whether the test is case-insensitivemultiLineSensitive
- whether the test is multi-line sensitive- Returns:
- the predicate to match the expression
-