Package com.sap.cds.ql
Interface Value<T>
-
- All Superinterfaces:
CqnToken
,CqnValue
,JSONizable
,Orderable
- All Known Subinterfaces:
ElementRef<T>
,FunctionCall<T>
,Literal<T>
,Parameter<T>
public interface Value<T> extends CqnValue, Orderable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description CqnSelectListValue
as(String alias)
Value<Number>
average()
Creates a function by passing this value as a parameter to the underlying data store's AVG function.Predicate
between(Value<T> low, Value<T> high)
Creates a between predicate that tests if this value is within a closed interval with given boundsPredicate
between(Value<T> low, T high)
Creates a between predicate that tests if this value is within a closed interval with given boundsPredicate
between(T low, Value<T> high)
Creates a between predicate that tests if this value is within a closed interval with given boundsPredicate
between(T low, T high)
Creates a between predicate that tests if this value is within a closed interval with given boundsdefault <U> Value<U>
cast(Class<U> javaType)
Deprecated.default <U> Value<U>
cast(String cdsType)
Deprecated.Predicate
contains(Value<String> substring)
Creates a predicate that tests whether this string value contains a given substringPredicate
contains(Value<String> substring, boolean caseInsensitive)
Creates a predicate that tests whether this string value contains a given substringPredicate
contains(String substring)
Creates a predicate that tests whether this string value contains a given substringValue<Long>
countDistinct()
Creates a function by passing this value as a parameter with the DISTINCT keyword to the underlying data store's COUNT function.Value<Number>
dividedBy(Value<? extends Number> d)
Creates an expression that divides this numeric value by a given divisorValue<Number>
dividedBy(Number d)
Creates an expression that divides this numeric value by a given divisorPredicate
endsWith(Value<String> suffix)
Creates a predicate that tests whether this string value ends with a given suffixPredicate
endsWith(String suffix)
Creates a predicate that tests whether this string value ends with a given suffixPredicate
eq(Value<T> v)
Creates a comparison predicate that tests if this value is equal to a given value.Predicate
eq(T v)
Creates a comparison predicate that tests if this value is equal to a given value.Predicate
func(String functionName, Value<?>... additional)
Creates a predicate that applies a given function to this values and optional additional valuesPredicate
ge(Value<T> v)
Creates a comparison predicate that tests if this value is greater than or equal to a given valuePredicate
ge(T v)
Creates a comparison predicate that tests if this value is greater than or equal to a given valuePredicate
gt(Value<T> v)
Creates a comparison predicate that tests if this value is greater than a given valuePredicate
gt(T v)
Creates a comparison predicate that tests if this value is greater than a given valuePredicate
in(Value<T>... ts)
Creates an IN predicate that tests if this value is equal to any value in a given listPredicate
in(Iterable<Value<? extends T>> ts)
Creates an IN predicate that tests if this value is equal to any value in a given listPredicate
in(List<? extends T> ts)
Creates an IN predicate that tests if this value is equal to any value in a given listPredicate
in(T... vs)
Creates an IN predicate that tests if this value is equal to any value in a given listPredicate
is(Value<T> v)
Creates a comparison predicate that tests if this value is equal to a given value.Predicate
is(T v)
Creates a comparison predicate that tests if this value is equal to a given value.Predicate
isNot(Value<T> v)
Creates a comparison predicate that tests if this value is not equal to a given value.Predicate
isNot(T v)
Creates a comparison predicate that tests if this value is not equal to a given value.Predicate
isNotNull()
Creates a predicate that tests if this value is not NULLPredicate
isNull()
Creates a predicate that tests if this value is NULLPredicate
le(Value<T> v)
Creates a comparison predicate that tests if this value is less than or equal to a given valuePredicate
le(T v)
Creates a comparison predicate that tests if this value is less than or equal to a given valuePredicate
lt(Value<T> v)
Creates a comparison predicate that tests if this value is less than a given valuePredicate
lt(T v)
Creates a comparison predicate that tests if this value is less than a given valueValue<T>
max()
Creates a function by passing this value as a parameter to the underlying data store's MAX function.Value<T>
min()
Creates a function by passing this value as a parameter to the underlying data store's MIN function.Value<Number>
minus(Value<? extends Number> s)
Creates an expression that subtracts a given subtrahend from this numeric valueValue<Number>
minus(Number s)
Creates an expression that subtracts a given subtrahend from this numeric valuePredicate
ne(Value<T> v)
Creates a comparison predicate that tests if this value is not equal to a given value.Predicate
ne(T v)
Creates a comparison predicate that tests if this value is not equal to a given value.Predicate
plain(Object... p)
Value<Number>
plus(Value<? extends Number> s)
Creates an expression that adds a given summand to this numeric valueValue<Number>
plus(Number s)
Creates an expression that adds a given summand to this numeric valuePredicate
startsWith(Value<String> prefix)
Creates a predicate that tests whether this string value starts with a given prefixPredicate
startsWith(String prefix)
Creates a predicate that tests whether this string value starts with a given prefixValue<String>
substring(int start)
Creates an expression for substring extraction from this string value.Value<String>
substring(int start, int length)
Creates an expression for substring extraction from this string value.Value<String>
substring(Value<Integer> start)
Creates an expression for substring extraction from this string value.Value<String>
substring(Value<Integer> start, Value<Integer> length)
Creates an expression for substring extraction from this value.Value<Number>
sum()
Creates a function by passing this value as a parameter to the underlying data store's SUM function.Value<Number>
times(Value<? extends Number> f)
Creates an expression that multiplies this numeric value with a given factorValue<Number>
times(Number f)
Creates an expression that multiplies this numeric value with a given factorValue<String>
toLower()
Creates an expression for converting this string value to lower case using the rules of the underlying data store.Value<String>
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)
<U> Value<U>
type(Class<U> javaType)
<U> Value<U>
type(String cdsType)
CqnSelectListValue
withoutAlias()
-
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, 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 Detail
-
plus
Value<Number> plus(Number s)
Creates an expression that adds a given summand to this numeric value- Parameters:
s
- the summand- Returns:
- expression for the addition
-
plus
Value<Number> plus(Value<? extends Number> s)
Creates an expression that adds a given summand to this numeric value- Parameters:
s
- the summand- Returns:
- expression for the addition
-
minus
Value<Number> minus(Number s)
Creates an expression that subtracts a given subtrahend from this numeric value- Parameters:
s
- the subtrahend- Returns:
- expression for the subtraction
-
minus
Value<Number> minus(Value<? extends Number> s)
Creates an expression that subtracts a given subtrahend from this numeric value- Parameters:
s
- the subtrahend- Returns:
- expression for the subtraction
-
times
Value<Number> times(Number f)
Creates an expression that multiplies this numeric value with a given factor- Parameters:
f
- the factor- Returns:
- expression for the multiplication
-
times
Value<Number> times(Value<? extends Number> f)
Creates an expression that multiplies this numeric value with a given factor- Parameters:
f
- the factor- Returns:
- expression for the multiplication
-
dividedBy
Value<Number> dividedBy(Number d)
Creates an expression that divides this numeric value by a given divisor- Parameters:
d
- the divisor- Returns:
- expression for the division
-
dividedBy
Value<Number> dividedBy(Value<? extends Number> d)
Creates an expression that divides this numeric value by a given divisor- Parameters:
d
- the divisor- Returns:
- expression for the division
-
substring
Value<String> substring(Value<Integer> start, Value<Integer> length)
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
Value<String> substring(int start, int length)
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
Value<String> substring(Value<Integer> start)
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
Value<String> substring(int start)
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
Value<String> 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
Value<String> 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
Value<T> min()
Creates a function by passing this value as a parameter to the underlying data store's MIN function.- Returns:
- the minimum value
-
max
Value<T> max()
Creates a function by passing this value as a parameter to the underlying data store's MAX function.- Returns:
- the maximum value
-
sum
Value<Number> 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
Value<Number> 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
Value<Long> 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
Predicate eq(T v)
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
Predicate eq(Value<T> v)
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
Predicate ne(T v)
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
Predicate ne(Value<T> v)
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
Predicate is(T v)
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
Predicate is(Value<T> v)
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
Predicate isNot(T v)
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
Predicate isNot(Value<T> v)
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
Predicate gt(T v)
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
Predicate gt(Value<T> v)
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
Predicate ge(T v)
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
Predicate ge(Value<T> v)
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
Predicate lt(T v)
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
Predicate lt(Value<T> v)
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
Predicate le(T v)
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
Predicate le(Value<T> v)
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
Predicate between(T low, T high)
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
Predicate between(Value<T> low, T high)
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
Predicate between(T low, Value<T> high)
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
Predicate between(Value<T> low, Value<T> high)
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
Predicate in(T... vs)
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
Predicate in(List<? extends T> ts)
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
Predicate in(Value<T>... ts)
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
Predicate in(Iterable<Value<? extends T>> ts)
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
-
func
Predicate func(String functionName, Value<?>... additional)
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
Predicate contains(String substring)
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
Predicate contains(Value<String> substring)
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
Predicate contains(Value<String> substring, boolean caseInsensitive)
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
Predicate startsWith(String prefix)
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
Predicate startsWith(Value<String> prefix)
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
Predicate endsWith(String suffix)
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
Predicate endsWith(Value<String> suffix)
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
CqnSelectListValue as(String alias)
-
withoutAlias
CqnSelectListValue withoutAlias()
-
type
<U> Value<U> type(CdsBaseType cdsType)
-
cast
@Deprecated default <U> Value<U> cast(Class<U> javaType)
Deprecated.
-
cast
@Deprecated default <U> Value<U> cast(String cdsType)
Deprecated.
-
-