Interface Expression

All Known Subinterfaces:
SelectableExpression

public interface Expression
An Expression used to specify either output values or logic criteria of a PipelineStage.

Expressions can be built:

  • from a DefaultQueryApi.Column provided by a Tables.Table
  • or from Exprs (via api.queryApi().exprs()) that gives access to Expressions building blocks
Expressions are not named by default, hence they cannot be directly added to an output columns list (that always needs a Selectable object). To do so, the as(String) method should be used. For example here is an example of an single stage pipeline using some expressions:

 def qapi = api.queryApi()
 def p = qapi.tables().products()
 qapi.source(
     p,
     [
         p.sku(), // a Column object
         qapi.exprs().string("foo").as("aStringLiteral"), // a literal expression built from Exprs
         p.sku().concat("bar").as("skuBar") // expression built from the column
         p.Cost().lessThan(5).as("veryInexpensive") // expression built from a column
     ],
     // a more complex expression
     qapi.exprs().and(
         p.sku().like("%foo"),
         p.Cost().lessThan(10)
     ) // no need to use `as()` here as only Expression object is expected (not Selectable)
 ).stream { it.each {
     row -> // row is a map having the following keys: ["sku", "aStringLiteral", "skuBar", "veryInexpensive"]
 }}
 
Since:
14.0 - Caribou Lou
  • Method Summary

    Modifier and Type
    Method
    Description
    as(String alias)
    Builds a SelectableExpression having the same value as this expression and named after the given alias.
    Builds an expression that cast this expression to a boolean value.
    Builds an expression that cast this expression to a date only value.
    Builds an expression that cast this expression to a datetime value.
    Builds an expression that cast this expression to an integer value.
    Builds an expression that cast this expression to a real number value.
    Builds an expression that cast this expression to a string value.
    Builds an expression that concatenates this expression to a given value.
    Builds an expression that concatenates this expression to a given value.
    Builds an expression that computes the value of this expression divided by the given value.
    Builds an expression that computes the value of this expression divided by the given value.
    Builds an expression evaluating if this expression is equal to the given boolean.
    Builds an expression evaluating if this expression is equal to the given number.
    Builds an expression evaluating if this expression is equal to the given String.
    equal(LocalDate dateWithoutTime)
    Builds an expression evaluating if this expression is equal to the given date object.
    equal(Date datetime)
    Builds an expression evaluating if this expression is equal to the given datetime object.
    Builds an expression evaluating if this expression is equal to the given expression.
    equal(DateTime datetime)
    Builds an expression evaluating if this expression is equal to the given datetime object.
    Builds an expression evaluating if this expression is equal to the given boolean.
    Builds an expression evaluating if this expression is equal to the given number.
    Builds an expression evaluating if this expression is equal to the given String.
    equalNullAware(LocalDate dateWithoutTime)
    Builds an expression evaluating if this expression is equal to the given date object.
    equalNullAware(Date datetime)
    Builds an expression evaluating if this expression is equal to the given datetime object.
    Builds an expression evaluating if this expression is equal to the given expression.
    equalNullAware(DateTime datetime)
    Builds an expression evaluating if this expression is equal to the given datetime object.
    Builds an expression evaluating if this expression is greater than or equal to the given number.
    greaterOrEqual(LocalDate dateWithoutTime)
    Builds an expression evaluating if this expression is greater than or equal to the given date object.
    greaterOrEqual(Date datetime)
    Builds an expression evaluating if this expression is greater than or equal to the given datetime object.
    Builds an expression evaluating if this expression is greater than or equal to the given expression.
    greaterOrEqual(DateTime datetime)
    Builds an expression evaluating if this expression is greater than or equal to the given datetime object.
    Builds an expression evaluating if this expression is strictly greater than the given number.
    greaterThan(LocalDate dateWithoutTime)
    Builds an expression evaluating if this expression is strictly greater than the given date object.
    greaterThan(Date datetime)
    Builds an expression evaluating if this expression is strictly greater than the given datetime object.
    Builds an expression evaluating if this expression is strictly greater than the given expression.
    greaterThan(DateTime datetime)
    Builds an expression evaluating if this expression is strictly greater than the given datetime object.
    Builds an expression evaluating if this expression is matching the standard SQL LIKE pattern provided by the given value.
    Builds an expression evaluating if this expression is matching the standard SQL LIKE pattern provided by the given value.
    in(List<?> e)
    Builds an expression evaluating if this expression is equal to any of the element of the given list.
    Builds an expression evaluating if this expression is false.
    Builds an expression evaluating if this expression is not null.
    Builds an expression evaluating if this expression is null.
    Builds an expression evaluating if this expression is true.
    Builds an expression that computes the lenght of this expression as a String.
    Builds an expression evaluating if this expression is lower than or equal to the given number.
    lessOrEqual(LocalDate dateWithoutTime)
    Builds an expression evaluating if this expression is lower than or equal to the given date object.
    lessOrEqual(Date datetime)
    Builds an expression evaluating if this expression is lower than or equal to the given datetime object.
    Builds an expression evaluating if this expression is lower than or equal to the given expression.
    lessOrEqual(DateTime datetime)
    Builds an expression evaluating if this expression is lower than or equal to the given datetime object.
    Builds an expression evaluating if this expression is strictly lower than the given number.
    lessThan(LocalDate dateWithoutTime)
    Builds an expression evaluating if this expression is strictly lower than the given date object.
    lessThan(Date datetime)
    Builds an expression evaluating if this expression is strictly lower than the given datetime object.
    Builds an expression evaluating if this expression is strictly lower than the given expression.
    lessThan(DateTime datetime)
    Builds an expression evaluating if this expression is strictly lower than the given datetime object.
    Builds an expression evaluating if this expression is matching the standard SQL LIKE pattern provided by the given value.
    Builds an expression evaluating if this expression is matching the standard SQL LIKE pattern provided by the given value.
    locate(String needle)
    Builds an expression that computes the first position (1-based index) of the given String in this expression.
    Builds an expression that computes the first position (1-based index) of the given String in this expression.
    Builds an expression that computes a lower case version of this expression.
    Builds an expression that computes the value of this expression minus the given value.
    Builds an expression that computes the value of this expression minus the given value.
    Builds an expression that computes the value of the remainder of the Euclidean division of this expression by the given value.
    Builds an expression that computes the value of the remainder of the Euclidean division of this expression by the given value.
    Builds an expression that computes the value of this expression multiplied by the given value.
    Builds an expression that computes the value of this expression multiplied by the given value.
    Builds an expression evaluating if this expression is not equal to the given boolean.
    Builds an expression evaluating if this expression is not equal to the given number.
    Builds an expression evaluating if this expression is not equal to the given String.
    notEqual(LocalDate dateWithoutTime)
    Builds an expression evaluating if this expression is not equal to the given date object.
    notEqual(Date datetime)
    Builds an expression evaluating if this expression is not equal to the given datetime object.
    Builds an expression evaluating if this expression is not equal to the given expression.
    notEqual(DateTime datetime)
    Builds an expression evaluating if this expression is not equal to the given datetime object.
    Builds an expression evaluating if this expression is not equal to the given boolean.
    Builds an expression evaluating if this expression is not equal to the given number.
    Builds an expression evaluating if this expression is not equal to the given String.
    notEqualNullAware(LocalDate dateWithoutTime)
    Builds an expression evaluating if this expression is not equal to the given date object.
    Builds an expression evaluating if this expression is not equal to the given datetime object.
    Builds an expression evaluating if this expression is not equal to the given expression.
    notEqualNullAware(DateTime datetime)
    Builds an expression evaluating if this expression is not equal to the given datetime object.
    Builds an expression evaluating if this expression is not matching the standard SQL LIKE pattern provided by the given value.
    Builds an expression evaluating if this expression is not matching the standard SQL LIKE pattern provided by the given value.
    notIn(List<?> e)
    Builds an expression evaluating if this expression not equal to all the element of the given list.
    Builds an expression evaluating if this expression is not matching the standard SQL LIKE pattern provided by the given value.
    Builds an expression evaluating if this expression is not matching the standard SQL LIKE pattern provided by the given value.
    Builds an expression that computes the value of this expression plus the given value.
    Builds an expression that computes the value of this expression plus the given value.
    substring(int fromIndex, int length)
    Builds an expression that computes a substring of this expression value.
    substring(Expression fromIndex, Expression length)
    Builds an expression that computes a substring of this expression value.
    Builds an expression that computes this expression without any starting or ending white space characters.
    Builds an expression that computes an upper case version of this expression.
  • Method Details

    • as

      Builds a SelectableExpression having the same value as this expression and named after the given alias.
      Parameters:
      alias - the name of the selectable expression to return
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • lessThan

      Expression lessThan(Expression e)
      Builds an expression evaluating if this expression is strictly lower than the given expression.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - an expression to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • lessThan

      Expression lessThan(Date datetime)
      Builds an expression evaluating if this expression is strictly lower than the given datetime object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      datetime - the Date object to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • lessThan

      Expression lessThan(DateTime datetime)
      Builds an expression evaluating if this expression is strictly lower than the given datetime object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      datetime - the Date object to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • lessThan

      Expression lessThan(LocalDate dateWithoutTime)
      Builds an expression evaluating if this expression is strictly lower than the given date object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      dateWithoutTime - Date object to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • lessThan

      Expression lessThan(Number e)
      Builds an expression evaluating if this expression is strictly lower than the given number.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - the Number to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • lessOrEqual

      Expression lessOrEqual(Expression e)
      Builds an expression evaluating if this expression is lower than or equal to the given expression.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - an expression to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • lessOrEqual

      Expression lessOrEqual(Date datetime)
      Builds an expression evaluating if this expression is lower than or equal to the given datetime object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      datetime - the Date object to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • lessOrEqual

      Expression lessOrEqual(DateTime datetime)
      Builds an expression evaluating if this expression is lower than or equal to the given datetime object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      datetime - the Date object to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • lessOrEqual

      Expression lessOrEqual(LocalDate dateWithoutTime)
      Builds an expression evaluating if this expression is lower than or equal to the given date object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      dateWithoutTime - Date object to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • lessOrEqual

      Expression lessOrEqual(Number e)
      Builds an expression evaluating if this expression is lower than or equal to the given number.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - the Number to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • greaterThan

      Expression greaterThan(Expression e)
      Builds an expression evaluating if this expression is strictly greater than the given expression.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - an expression to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • greaterThan

      Expression greaterThan(Date datetime)
      Builds an expression evaluating if this expression is strictly greater than the given datetime object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      datetime - the Date object to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • greaterThan

      Expression greaterThan(DateTime datetime)
      Builds an expression evaluating if this expression is strictly greater than the given datetime object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      datetime - the Date object to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • greaterThan

      Expression greaterThan(LocalDate dateWithoutTime)
      Builds an expression evaluating if this expression is strictly greater than the given date object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      dateWithoutTime - Date object to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • greaterThan

      Expression greaterThan(Number e)
      Builds an expression evaluating if this expression is strictly greater than the given number.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - the Number to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • greaterOrEqual

      Expression greaterOrEqual(Expression e)
      Builds an expression evaluating if this expression is greater than or equal to the given expression.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - an expression to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • greaterOrEqual

      Expression greaterOrEqual(Date datetime)
      Builds an expression evaluating if this expression is greater than or equal to the given datetime object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      datetime - the Date object to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • greaterOrEqual

      Expression greaterOrEqual(DateTime datetime)
      Builds an expression evaluating if this expression is greater than or equal to the given datetime object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      datetime - the Date object to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • greaterOrEqual

      Expression greaterOrEqual(LocalDate dateWithoutTime)
      Builds an expression evaluating if this expression is greater than or equal to the given date object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      dateWithoutTime - Date object to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • greaterOrEqual

      Expression greaterOrEqual(Number e)
      Builds an expression evaluating if this expression is greater than or equal to the given number.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - the Number to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • equal

      Builds an expression evaluating if this expression is equal to the given expression.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - the expression to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • equal

      Expression equal(String e)
      Builds an expression evaluating if this expression is equal to the given String.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - the String to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • equal

      Expression equal(Date datetime)
      Builds an expression evaluating if this expression is equal to the given datetime object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      datetime - the datetime to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • equal

      Expression equal(DateTime datetime)
      Builds an expression evaluating if this expression is equal to the given datetime object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      datetime - the datetime to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • equal

      Expression equal(LocalDate dateWithoutTime)
      Builds an expression evaluating if this expression is equal to the given date object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      dateWithoutTime - the date to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • equal

      Expression equal(Number e)
      Builds an expression evaluating if this expression is equal to the given number.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - the number to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • equal

      Expression equal(Boolean e)
      Builds an expression evaluating if this expression is equal to the given boolean.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - the boolean to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • equalNullAware

      Expression equalNullAware(Expression e)
      Builds an expression evaluating if this expression is equal to the given expression.

      This null aware version will return

      • true if this expression and the given value are both null
      • false if only one of this expression or the given value is null
      • otherwise it will return the result of the normal equality
      Parameters:
      e - the expression to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • equalNullAware

      Expression equalNullAware(String e)
      Builds an expression evaluating if this expression is equal to the given String.

      This null aware version will return

      • true if this expression and the given value are both null
      • false if only one of this expression or the given value is null
      • otherwise it will return the result of the normal equality
      Parameters:
      e - the String to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • equalNullAware

      Expression equalNullAware(Date datetime)
      Builds an expression evaluating if this expression is equal to the given datetime object.

      This null aware version will return

      • true if this expression and the given value are both null
      • false if only one of this expression or the given value is null
      • otherwise it will return the result of the normal equality
      Parameters:
      datetime - the datetime to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • equalNullAware

      Expression equalNullAware(DateTime datetime)
      Builds an expression evaluating if this expression is equal to the given datetime object.

      This null aware version will return

      • true if this expression and the given value are both null
      • false if only one of this expression or the given value is null
      • otherwise it will return the result of the normal equality
      Parameters:
      datetime - the datetime to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • equalNullAware

      Expression equalNullAware(LocalDate dateWithoutTime)
      Builds an expression evaluating if this expression is equal to the given date object.

      This null aware version will return

      • true if this expression and the given value are both null
      • false if only one of this expression or the given value is null
      • otherwise it will return the result of the normal equality
      Parameters:
      dateWithoutTime - the date to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • equalNullAware

      Expression equalNullAware(Number e)
      Builds an expression evaluating if this expression is equal to the given number.

      This null aware version will return

      • true if this expression and the given value are both null
      • false if only one of this expression or the given value is null
      • otherwise it will return the result of the normal equality
      Parameters:
      e - the number to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • equalNullAware

      Expression equalNullAware(Boolean e)
      Builds an expression evaluating if this expression is equal to the given boolean.

      This null aware version will return

      • true if this expression and the given value are both null
      • false if only one of this expression or the given value is null
      • otherwise it will return the result of the normal equality
      Parameters:
      e - the boolean to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • notEqual

      Expression notEqual(Expression e)
      Builds an expression evaluating if this expression is not equal to the given expression.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - the expression to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • notEqual

      Expression notEqual(String e)
      Builds an expression evaluating if this expression is not equal to the given String.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - the String to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • notEqual

      Expression notEqual(Date datetime)
      Builds an expression evaluating if this expression is not equal to the given datetime object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      datetime - the datetime to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • notEqual

      Expression notEqual(DateTime datetime)
      Builds an expression evaluating if this expression is not equal to the given datetime object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      datetime - the datetime to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • notEqual

      Expression notEqual(LocalDate dateWithoutTime)
      Builds an expression evaluating if this expression is not equal to the given date object.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      dateWithoutTime - the date to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • notEqual

      Expression notEqual(Number e)
      Builds an expression evaluating if this expression is not equal to the given number.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - the number to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • notEqual

      Expression notEqual(Boolean e)
      Builds an expression evaluating if this expression is not equal to the given boolean.

      If this expression or the given value is null then this expression will evaluate to null

      Parameters:
      e - the boolean to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • notEqualNullAware

      Expression notEqualNullAware(Expression e)
      Builds an expression evaluating if this expression is not equal to the given expression.

      This null aware version will return

      • false if this expression and the given value are both null
      • true if only one of this expression or the given value is null
      • otherwise it will return the result of the normal non equality
      Parameters:
      e - the expression to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • notEqualNullAware

      Expression notEqualNullAware(String e)
      Builds an expression evaluating if this expression is not equal to the given String.

      This null aware version will return

      • false if this expression and the given value are both null
      • true if only one of this expression or the given value is null
      • otherwise it will return the result of the normal non equality
      Parameters:
      e - the String to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • notEqualNullAware

      Expression notEqualNullAware(Date datetime)
      Builds an expression evaluating if this expression is not equal to the given datetime object.

      This null aware version will return

      • false if this expression and the given value are both null
      • true if only one of this expression or the given value is null
      • otherwise it will return the result of the normal non equality
      Parameters:
      datetime - the datetime to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • notEqualNullAware

      Expression notEqualNullAware(DateTime datetime)
      Builds an expression evaluating if this expression is not equal to the given datetime object.

      This null aware version will return

      • false if this expression and the given value are both null
      • true if only one of this expression or the given value is null
      • otherwise it will return the result of the normal non equality
      Parameters:
      datetime - the datetime to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • notEqualNullAware

      Expression notEqualNullAware(LocalDate dateWithoutTime)
      Builds an expression evaluating if this expression is not equal to the given date object.

      This null aware version will return

      • false if this expression and the given value are both null
      • true if only one of this expression or the given value is null
      • otherwise it will return the result of the normal non equality
      Parameters:
      dateWithoutTime - the date to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • notEqualNullAware

      Expression notEqualNullAware(Number e)
      Builds an expression evaluating if this expression is not equal to the given number.

      This null aware version will return

      • false if this expression and the given value are both null
      • true if only one of this expression or the given value is null
      • otherwise it will return the result of the normal non equality
      Parameters:
      e - the number to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • notEqualNullAware

      Expression notEqualNullAware(Boolean e)
      Builds an expression evaluating if this expression is not equal to the given boolean.

      This null aware version will return

      • false if this expression and the given value are both null
      • true if only one of this expression or the given value is null
      • otherwise it will return the result of the normal non equality
      Parameters:
      e - the boolean to be compared with this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • like

      Builds an expression evaluating if this expression is matching the standard SQL LIKE pattern provided by the given value.

      This operator is case-sensitive.

      Specification of the pattern can be find on w3shcools website or on the PosgreSQL official documentation.

      As an example qapi.tables().products().sku().like("%foo%") will be true for any sku containing the "foo" string.

      Parameters:
      e - an expression providing given standard SQL LIKE pattern
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • like

      Expression like(String e)
      Builds an expression evaluating if this expression is matching the standard SQL LIKE pattern provided by the given value.

      This operator is case-sensitive.

      Specification of the pattern can be find on w3shcools website or on the PosgreSQL official documentation.

      As an example qapi.tables().products().sku().like("%foo%") will be true for any sku containing the "foo" string.

      Parameters:
      e - a string providing given standard SQL LIKE pattern
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • ilike

      Builds an expression evaluating if this expression is matching the standard SQL LIKE pattern provided by the given value.

      This operator is case-insensitive.

      Specification of the pattern can be find on w3shcools website or on the PosgreSQL official documentation.

      As an example qapi.tables().products().sku().like("%foo%") will be true for any sku containing the "foo" string with any combination of upper or lower case characters.

      Parameters:
      e - an expression providing given standard SQL LIKE pattern
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • ilike

      Expression ilike(String e)
      Builds an expression evaluating if this expression is matching the standard SQL LIKE pattern provided by the given value.

      This operator is case-insensitive.

      Specification of the pattern can be find on w3shcools website or on the PosgreSQL official documentation.

      As an example qapi.tables().products().sku().like("%foo%") will be true for any sku containing the "foo" string with any combination of upper or lower case characters.

      Parameters:
      e - a string providing given standard SQL LIKE pattern
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • notLike

      Expression notLike(Expression e)
      Builds an expression evaluating if this expression is not matching the standard SQL LIKE pattern provided by the given value.

      This operator is case-sensitive.

      Parameters:
      e - a string providing given standard SQL LIKE pattern
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • notLike

      Expression notLike(String e)
      Builds an expression evaluating if this expression is not matching the standard SQL LIKE pattern provided by the given value.

      This operator is case-sensitive.

      Parameters:
      e - a string providing given standard SQL LIKE pattern
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • notIlike

      Expression notIlike(Expression e)
      Builds an expression evaluating if this expression is not matching the standard SQL LIKE pattern provided by the given value.

      This operator is case-insensitive.

      Parameters:
      e - a string providing given standard SQL LIKE pattern
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • notIlike

      Expression notIlike(String e)
      Builds an expression evaluating if this expression is not matching the standard SQL LIKE pattern provided by the given value.

      This operator is case-insensitive.

      Parameters:
      e - a string providing given standard SQL LIKE pattern
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • in

      Expression in(List<?> e)
      Builds an expression evaluating if this expression is equal to any of the element of the given list.

      Works only with homogenous lists containing elements of the following types: String, Number, Boolean (note that it does not work with Date, org.joda.time.DateTime, java.time.LocalDate)

      Parameters:
      e - the list of value to be compared to this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • notIn

      Expression notIn(List<?> e)
      Builds an expression evaluating if this expression not equal to all the element of the given list.

      Works only with homogenous lists containing elements of the following types: String, Number, Boolean (note that it does not work with Date, org.joda.time.DateTime, java.time.LocalDate)

      Parameters:
      e - the list of value to be compared to this expression
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • isNull

      Expression isNull()
      Builds an expression evaluating if this expression is null.
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • isNotNull

      Expression isNotNull()
      Builds an expression evaluating if this expression is not null.
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • isTrue

      Expression isTrue()
      Builds an expression evaluating if this expression is true.
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • isFalse

      Expression isFalse()
      Builds an expression evaluating if this expression is false.
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • castAsString

      Expression castAsString()
      Builds an expression that cast this expression to a string value.
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • castAsReal

      Expression castAsReal()
      Builds an expression that cast this expression to a real number value.
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • castAsInteger

      Expression castAsInteger()
      Builds an expression that cast this expression to an integer value.
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • castAsBoolean

      Expression castAsBoolean()
      Builds an expression that cast this expression to a boolean value.
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • castAsDateOnly

      Expression castAsDateOnly()
      Builds an expression that cast this expression to a date only value.
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • castAsDateTime

      Expression castAsDateTime()
      Builds an expression that cast this expression to a datetime value.
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • concat

      Builds an expression that concatenates this expression to a given value.
      Parameters:
      e - the expression to be concatenated
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • concat

      Expression concat(String e)
      Builds an expression that concatenates this expression to a given value.
      Parameters:
      e - the String to be concatenated
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
    • substring

      Expression substring(Expression fromIndex, Expression length)
      Builds an expression that computes a substring of this expression value.

      fromIndex should be a 1-based index as a result:

      
       qapi.exprs().string("fooBar").subString(1, 4) // evaluates to "fooB"
       qapi.exprs().string("fooBar").subString(4, 10) // evaluates to "Bar"
       
      Parameters:
      fromIndex - the 1-based index start of the substring to extract
      length - the max length of the substring to extract
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • substring

      Expression substring(int fromIndex, int length)
      Builds an expression that computes a substring of this expression value.

      fromIndex should be a 1-based index as a result:

      
       qapi.exprs().string("fooBar").subString(1, 4) // evaluates to "fooB"
       qapi.exprs().string("fooBar").subString(4, 10) // evaluates to "Bar"
       
      Parameters:
      fromIndex - the 1-based index start of the substring to extract
      length - the max length of the substring to extract
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • upper

      Expression upper()
      Builds an expression that computes an upper case version of this expression.
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • lower

      Expression lower()
      Builds an expression that computes a lower case version of this expression.
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • trim

      Expression trim()
      Builds an expression that computes this expression without any starting or ending white space characters.
      
       qapi.exprs().string("  fooBar  \t ").trim() // evaluates to "fooBar", removes trailing and starting tabs and spaces
       
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • length

      Expression length()
      Builds an expression that computes the lenght of this expression as a String.
      Returns:
      the build expression
      Since:
      14.0 - Caribou Lou
    • locate

      Expression locate(Expression needle)
      Builds an expression that computes the first position (1-based index) of the given String in this expression.
      Parameters:
      needle - the expression of the String to be searched
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • locate

      Expression locate(String needle)
      Builds an expression that computes the first position (1-based index) of the given String in this expression.
      Parameters:
      needle - the String to be searched
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • plus

      Builds an expression that computes the value of this expression plus the given value.
      Parameters:
      e - the expression to be added
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • plus

      Expression plus(Number e)
      Builds an expression that computes the value of this expression plus the given value.
      Parameters:
      e - the Number to be added
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • minus

      Builds an expression that computes the value of this expression minus the given value.
      Parameters:
      e - the expression to be subtracted
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • minus

      Expression minus(Number e)
      Builds an expression that computes the value of this expression minus the given value.
      Parameters:
      e - the Number to be subtracted
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • multiply

      Expression multiply(Expression e)
      Builds an expression that computes the value of this expression multiplied by the given value.
      Parameters:
      e - the factor to be multiplied with
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • multiply

      Expression multiply(Number e)
      Builds an expression that computes the value of this expression multiplied by the given value.
      Parameters:
      e - the factor to be multiplied with
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • div

      Builds an expression that computes the value of this expression divided by the given value.
      Parameters:
      e - the divisor
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • div

      Builds an expression that computes the value of this expression divided by the given value.
      Parameters:
      e - the divisor
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • mod

      Builds an expression that computes the value of the remainder of the Euclidean division of this expression by the given value.
      Parameters:
      e - the divisor
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also:
    • mod

      Builds an expression that computes the value of the remainder of the Euclidean division of this expression by the given value.
      Parameters:
      e - the divisor
      Returns:
      the built expression
      Since:
      14.0 - Caribou Lou
      See Also: