Package com.couchbase.lite
Class Expression
java.lang.Object
com.couchbase.lite.Expression
- Direct Known Subclasses:
MetaExpression
,PredictionFunction
,PropertyExpression
,VariableExpression
The expression used in constructing a query.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(Expression expression) Create an add expression to add the given expression to the current expressionstatic PropertyExpression
all()
Creates a * expression to express all propertiesand
(Expression expression) Create a logical AND expression that performs logical AND operation with the current expression.between
(Expression expression1, Expression expression2) Create a between expression that evaluates whether or not the current expression is between the given expressions inclusively.static Expression
booleanValue
(boolean value) Create value expression with given boolean valueCreates a Collate expression with the given Collation specification.static Expression
Create value expression with given Date valuedivide
(Expression expression) Create a divide expression to divide the current expression by the given expression.static Expression
doubleValue
(double value) Create value expression with given double valueequalTo
(Expression expression) Create an equal to expression that evaluates whether or not the current expression is equal to the given expression.static Expression
floatValue
(float value) Create value expression with given float valuestatic FullTextIndexExpression
fullTextIndex
(String indexName) Create a full-text index expression referencing a full-text index with the given index name.greaterThan
(Expression expression) Create a greater than expression that evaluates whether or not the current expression is greater than the given expression.greaterThanOrEqualTo
(Expression expression) Create a greater than or equal to expression that evaluates whether or not the current expression is greater than or equal to the given expression.in
(Expression... expressions) Create an IN expression that evaluates whether or not the current expression is in the given expressions.static Expression
intValue
(int value) Create value expression with given integer valueis
(Expression expression) Create an IS expression that evaluates whether or not the current expression is equal to the given expression.isNot
(Expression expression) Create an IS NOT expression that evaluates whether or not the current expression is not equal to the given expression.Creates an IS NOT VALUED expression that returns true if the current expression is NOT VALUED.Deprecated.Use Expression.isNotValuedisValued()
Creates an IS VALUED expression that returns true if the current expression is valued.lessThan
(Expression expression) Create a less than expression that evaluates whether or not the current expression is less than the given expression.lessThanOrEqualTo
(Expression expression) Create a less than or equal to expression that evaluates whether or not the current expression is less than or equal to the given expression.like
(Expression expression) Create a Like expression that evaluates whether or not the current expression is LIKE the given expression.static Expression
Create value expression with the given list.static Expression
longValue
(long value) Create value expression with given long valuestatic Expression
Creates value expression with the given map.modulo
(Expression expression) Create a modulo expression to modulo the current expression by the given expression.multiply
(Expression expression) Create a multiply expression to multiply the current expression by the given expression.static Expression
negated
(Expression expression) Create a negated expression to represent the negated result of the given expression.static Expression
not
(Expression expression) Create a negated expression to represent the negated result of the given expression.notEqualTo
(Expression expression) Create a NOT equal to expression that evaluates whether or not the current expression is not equal to the given expression.Deprecated.Use Expression.isValuedstatic Expression
Create value expression with given Number valueor
(Expression expression) Create a logical OR expression that performs logical OR operation with the current expression.static Expression
Creates a parameter expression with the given parameter name.static PropertyExpression
Create a property expression representing the value of the given property.regex
(Expression expression) Create a regex match expression that evaluates whether or not the current expression regex matches the given expression.static Expression
Create value expression with given String valuesubtract
(Expression expression) Create a subtract expression to subtract the given expression from the current expression.toString()
static Expression
Create value expression with given value
-
Constructor Details
-
Expression
public Expression()
-
-
Method Details
-
value
Create value expression with given value- Parameters:
value
- the value- Returns:
- the value expression
-
string
Create value expression with given String value- Parameters:
value
- the String value- Returns:
- the value expression
-
number
Create value expression with given Number value- Parameters:
value
- the Number value- Returns:
- the value expression
-
intValue
Create value expression with given integer value- Parameters:
value
- the integer value- Returns:
- the value expression
-
longValue
Create value expression with given long value- Parameters:
value
- the long value- Returns:
- the value expression
-
floatValue
Create value expression with given float value- Parameters:
value
- the float value- Returns:
- the value expression
-
doubleValue
Create value expression with given double value- Parameters:
value
- the double value- Returns:
- the value expression
-
booleanValue
Create value expression with given boolean value- Parameters:
value
- the boolean value- Returns:
- the value expression
-
date
Create value expression with given Date value- Parameters:
value
- the Date value- Returns:
- the value expression
-
map
Creates value expression with the given map.- Parameters:
value
- the map value- Returns:
- the value expression.
-
list
Create value expression with the given list.- Parameters:
value
- the list value.- Returns:
- the value expression.
-
all
Creates a * expression to express all properties- Returns:
- a property expression.
-
property
Create a property expression representing the value of the given property.- Parameters:
property
- the name of the property in the form of a key path.- Returns:
- a property expression.
-
parameter
Creates a parameter expression with the given parameter name.- Parameters:
name
- The parameter name- Returns:
- A parameter expression.
-
negated
Create a negated expression to represent the negated result of the given expression.- Parameters:
expression
- the expression to be negated.- Returns:
- a negated expression.
-
not
Create a negated expression to represent the negated result of the given expression.- Parameters:
expression
- the expression to be negated.- Returns:
- a negated expression.
-
fullTextIndex
Create a full-text index expression referencing a full-text index with the given index name.When there is a need to specify the data source in which the index has been created (e.g. in multi-collection join statement, calls the from(_ alias: String) method from the returned FullTextIndexExpressionProtocol object to specify the data source.
- Parameters:
indexName
- The name of the full-text index.- Returns:
- The full-text index expression referring to a full text index in the specified data source.
-
toString
-
multiply
Create a multiply expression to multiply the current expression by the given expression.- Parameters:
expression
- the expression to multiply by.- Returns:
- a multiply expression.
-
divide
Create a divide expression to divide the current expression by the given expression.- Parameters:
expression
- the expression to divide by.- Returns:
- a divide expression.
-
modulo
Create a modulo expression to modulo the current expression by the given expression.- Parameters:
expression
- the expression to modulo by.- Returns:
- a modulo expression.
-
add
Create an add expression to add the given expression to the current expression- Parameters:
expression
- an expression to add to the current expression.- Returns:
- an add expression.
-
subtract
Create a subtract expression to subtract the given expression from the current expression.- Parameters:
expression
- an expression to subtract from the current expression.- Returns:
- a subtract expression.
-
lessThan
Create a less than expression that evaluates whether or not the current expression is less than the given expression.- Parameters:
expression
- the expression to compare with the current expression.- Returns:
- a less than expression.
-
lessThanOrEqualTo
Create a less than or equal to expression that evaluates whether or not the current expression is less than or equal to the given expression.- Parameters:
expression
- the expression to compare with the current expression.- Returns:
- a less than or equal to expression.
-
greaterThan
Create a greater than expression that evaluates whether or not the current expression is greater than the given expression.- Parameters:
expression
- the expression to compare with the current expression.- Returns:
- a greater than expression.
-
greaterThanOrEqualTo
Create a greater than or equal to expression that evaluates whether or not the current expression is greater than or equal to the given expression.- Parameters:
expression
- the expression to compare with the current expression.- Returns:
- a greater than or equal to expression.
-
equalTo
Create an equal to expression that evaluates whether or not the current expression is equal to the given expression.- Parameters:
expression
- the expression to compare with the current expression.- Returns:
- an equal to expression.
-
notEqualTo
Create a NOT equal to expression that evaluates whether or not the current expression is not equal to the given expression.- Parameters:
expression
- the expression to compare with the current expression.- Returns:
- a NOT equal to expression.
-
and
Create a logical AND expression that performs logical AND operation with the current expression.- Parameters:
expression
- the expression to AND with the current expression.- Returns:
- a logical AND expression.
-
or
Create a logical OR expression that performs logical OR operation with the current expression.- Parameters:
expression
- the expression to OR with the current expression.- Returns:
- a logical OR expression.
-
like
Create a Like expression that evaluates whether or not the current expression is LIKE the given expression.- Parameters:
expression
- the expression to compare with the current expression.- Returns:
- a Like expression.
-
regex
Create a regex match expression that evaluates whether or not the current expression regex matches the given expression.- Parameters:
expression
- the expression to compare with the current expression.- Returns:
- a regex match expression.
-
is
Create an IS expression that evaluates whether or not the current expression is equal to the given expression.- Parameters:
expression
- the expression to compare with the current expression.- Returns:
- an IS expression.
-
isNot
Create an IS NOT expression that evaluates whether or not the current expression is not equal to the given expression.- Parameters:
expression
- the expression to compare with the current expression.- Returns:
- an IS NOT expression.
-
between
@NonNull public Expression between(@NonNull Expression expression1, @NonNull Expression expression2) Create a between expression that evaluates whether or not the current expression is between the given expressions inclusively.- Parameters:
expression1
- the inclusive lower bound expression.expression2
- the inclusive upper bound expression.- Returns:
- a between expression.
-
collate
Creates a Collate expression with the given Collation specification. Commonly the collate expression is used in the Order BY clause or the string comparison  expression (e.g. equalTo or lessThan) to specify how the two strings are compared.- Parameters:
collation
- The collation object.- Returns:
- A Collate expression.
-
in
Create an IN expression that evaluates whether or not the current expression is in the given expressions.- Parameters:
expressions
- the expression array to evaluate with.- Returns:
- an IN expression.
-
isValued
Creates an IS VALUED expression that returns true if the current expression is valued.- Returns:
- An IS VALUED expression.
-
isNotValued
Creates an IS NOT VALUED expression that returns true if the current expression is NOT VALUED.- Returns:
- An IS NOT VALUED expression.
-
isNullOrMissing
Deprecated.Use Expression.isNotValuedCreates an IS NULL OR MISSING expression that evaluates whether or not the current expression is null or missing.- Returns:
- An IS NULL expression.
-
notNullOrMissing
Deprecated.Use Expression.isValuedCreates an NOT IS NULL OR MISSING expression that evaluates whether or not the current expression is NOT null or missing.- Returns:
- An NOT IS NULL expression.
-