Interface Value<T>

All Superinterfaces:
CqnToken, CqnValue, JSONizable, Orderable
All Known Subinterfaces:
BooleanValue, ElementRef<T>, FunctionCall<T>, Literal<T>, NullValue, Parameter<T>

public interface Value<T> extends CqnValue, Orderable
  • Method Summary

    Modifier and Type
    Method
    Description
    as(String alias)
     
    Creates a function by passing this value as a parameter to the underlying data store's AVG function.
    between(Value<T> low, Value<T> high)
    Creates a between predicate that tests if this value is within a closed interval with given bounds
    between(Value<T> low, T high)
    Creates a between predicate that tests if this value is within a closed interval with given bounds
    between(T low, Value<T> high)
    Creates a between predicate that tests if this value is within a closed interval with given bounds
    between(T low, T high)
    Creates a between predicate that tests if this value is within a closed interval with given bounds
    contains(Value<String> substring)
    Creates a predicate that tests whether this string value contains a given substring
    contains(Value<String> substring, boolean caseInsensitive)
    Creates a predicate that tests whether this string value contains a given substring
    contains(String substring)
    Creates a predicate that tests whether this string value contains a given substring
    Creates a function by passing this value as a parameter with the DISTINCT keyword to the underlying data store's COUNT function.
    dividedBy(Value<? extends Number> d)
    Creates an expression that divides this numeric value by a given divisor
    Creates an expression that divides this numeric value by a given divisor
    Creates a predicate that tests whether this string value ends with a given suffix
    endsWith(String suffix)
    Creates a predicate that tests whether this string value ends with a given suffix
    eq(Value<T> v)
    Creates a comparison predicate that tests if this value is equal to a given value.
    eq(T v)
    Creates a comparison predicate that tests if this value is equal to a given value.
    func(String functionName, Value<?>... additional)
    Creates a predicate that applies a given function to this values and optional additional values
    ge(Value<T> v)
    Creates a comparison predicate that tests if this value is greater than or equal to a given value
    ge(T v)
    Creates a comparison predicate that tests if this value is greater than or equal to a given value
    gt(Value<T> v)
    Creates a comparison predicate that tests if this value is greater than a given value
    gt(T v)
    Creates a comparison predicate that tests if this value is greater than a given value
    in(Value<T>... ts)
    Creates an IN predicate that tests if this value is equal to any value in a given list
    in(Iterable<Value<? extends T>> ts)
    Creates an IN predicate that tests if this value is equal to any value in a given list
    in(List<? extends T> ts)
    Creates an IN predicate that tests if this value is equal to any value in a given list
    in(T... vs)
    Creates an IN predicate that tests if this value is equal to any value in a given list
    is(Value<T> v)
    Creates a comparison predicate that tests if this value is equal to a given value.
    is(T v)
    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.
    isNot(T v)
    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 NULL
    Creates a predicate that tests if this value is NULL
    le(Value<T> v)
    Creates a comparison predicate that tests if this value is less than or equal to a given value
    le(T v)
    Creates a comparison predicate that tests if this value is less than or equal to a given value
    lt(Value<T> v)
    Creates a comparison predicate that tests if this value is less than a given value
    lt(T v)
    Creates a comparison predicate that tests if this value is less than a given value
    max()
    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.
    minus(Value<? extends Number> s)
    Creates an expression that subtracts a given subtrahend from this numeric value
    Creates an expression that subtracts a given subtrahend from this numeric value
    ne(Value<T> v)
    Creates a comparison predicate that tests if this value is not equal to a given value.
    ne(T v)
    Creates a comparison predicate that tests if this value is not equal to a given value.
    plain(Object... p)
     
    plus(Value<? extends Number> s)
    Creates an expression that adds a given summand to this numeric value
    Creates an expression that adds a given summand to this numeric value
    Creates a predicate that tests whether this string value starts with a given prefix
    Creates a predicate that tests whether this string value starts with a given prefix
    substring(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.
    substring(Value<Integer> start, Value<Integer> length)
    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.
    times(Value<? extends Number> f)
    Creates an expression that multiplies this numeric value with a given factor
    Creates an expression that multiplies this numeric value with a given factor
    Creates an expression for converting this string value to lower case using the rules of the underlying data store.
    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>
    type(Class<U> javaType)
    Sets the type.
    <U> Value<U>
    type(String cdsType)
    Sets the type.
     

    Methods inherited from interface com.sap.cds.ql.cqn.CqnToken

    accept, tokens

    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

      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 position
      length - 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 position
      length - 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 bound
      high - 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 bound
      high - 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 bound
      high - 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 bound
      high - 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
    • plain

      Predicate plain(Object... p)
    • 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 name
      additional - 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 substring
      caseInsensitive - 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

    • withoutAlias

      CqnSelectListValue withoutAlias()
    • type

      <U> Value<U> type(Class<U> javaType)
      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

      <U> Value<U> type(CdsBaseType cdsType)
      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

      <U> Value<U> type(String cdsType)
      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