public final class Expressions extends Object
Modifier and Type | Field and Description |
---|---|
static String |
ADD
The "$add" operator token
|
static String |
AND
The "$and" operator token
|
static String |
COMPARE
The "$cmp" operator token
|
static String |
CONCATENATE
The "$concat" operator token
|
static String |
CONDITION
The "$cond" operator token
|
static String |
DAY_OF_MONTH
The "$dayOfMonth" operator token
|
static String |
DAY_OF_WEEK
The "$dayOfWeek" operator token
|
static String |
DAY_OF_YEAR
The "$dayOfYear" operator token
|
static String |
DIVIDE
The "$divide" operator token
|
static String |
EQUAL
The "$eq" operator token
|
static String |
GREATER_THAN
The "$gt" operator token
|
static String |
GREATER_THAN_OR_EQUAL
The "$gte" operator token
|
static String |
HOUR
The "$hour" operator token
|
static String |
IF_NULL
The "$ifNull" operator token
|
static String |
LESS_THAN
The "$lt" operator token
|
static String |
LESS_THAN_OR_EQUAL
The "$lte" operator token
|
static String |
MILLISECOND
The "$millisecond" operator token
|
static String |
MINUTE
The "$minute" operator token
|
static String |
MODULO
The "$mod" operator token
|
static String |
MONTH
The "$month" operator token
|
static String |
MULTIPLY
The "$multiply" operator token
|
static String |
NOT
The "$not" operator token
|
static String |
NOT_EQUAL
The "$ne" operator token
|
static String |
OR
The "$or" operator token
|
static String |
SECOND
The "$second" operator token
|
static String |
STRING_CASE_INSENSITIVE_COMPARE
The "$strcasecmp" operator token
|
static String |
SUB_STRING
The "$substr" operator token
|
static String |
SUBTRACT
The "$subtract" operator token
|
static String |
TO_LOWER
The "$toLower" operator token
|
static String |
TO_UPPER
The "$toUpper" operator token
|
static String |
WEEK
The "$week" operator token
|
static String |
YEAR
The "$year" operator token
|
Modifier and Type | Method and Description |
---|---|
static NaryExpression |
add(Expression... expressions)
Returns an
NaryExpression "$add" expression. |
static NaryExpression |
and(Expression... expressions)
Returns an
NaryExpression "$and" expression. |
static NaryExpression |
cmp(Expression lhs,
Expression rhs)
Returns a
NaryExpression "$cmp" expression. |
static NaryExpression |
concatenate(Expression... expression)
Returns a
NaryExpression "$concat" expression. |
static NaryExpression |
cond(Expression test,
Expression trueResult,
Expression falseResult)
Returns a
NaryExpression "$cond" expression. |
static Constant |
constant(boolean value)
Returns a
Constant expression with the provided value. |
static Constant |
constant(Date value)
Returns a
Constant expression with the provided value. |
static Constant |
constant(double value)
Returns a
Constant expression with the provided value. |
static Constant |
constant(int value)
Returns a
Constant expression with the provided value. |
static Constant |
constant(long value)
Returns a
Constant expression with the provided value. |
static Constant |
constant(ObjectId value)
Returns a
Constant expression with the provided value. |
static Constant |
constant(Pattern value)
Returns a
Constant expression with the provided value. |
static Constant |
constant(String value)
Returns a
Constant expression with the provided value. |
static Constant |
constantMongoTimestamp(long value)
Returns a
Constant expression with the provided value. |
static Constant |
constantTimestamp(long value)
Returns a
Constant expression with the provided value. |
static UnaryExpression |
dayOfMonth(Expression expression)
Returns a
UnaryExpression "$dayOfMonth" expression. |
static UnaryExpression |
dayOfWeek(Expression expression)
Returns a
UnaryExpression "$dayOfWeek" expression. |
static UnaryExpression |
dayOfYear(Expression expression)
Returns a
UnaryExpression "$dayOfYear" expression. |
static NaryExpression |
divide(Expression numerator,
Expression denominator)
Returns a
NaryExpression "$divide" expression. |
static NaryExpression |
eq(Expression lhs,
Expression rhs)
Returns a
NaryExpression "$eq" expression. |
static Constant |
field(String value)
Returns a
Constant expression with the provided value. |
static NaryExpression |
gt(Expression lhs,
Expression rhs)
Returns a
NaryExpression "$gt" expression. |
static NaryExpression |
gte(Expression lhs,
Expression rhs)
Returns a
NaryExpression "$gte"
expression. |
static UnaryExpression |
hour(Expression expression)
Returns a
UnaryExpression "$hour" expression. |
static NaryExpression |
ifNull(Expression first,
Expression second)
Returns a
NaryExpression "$ifNull" expression. |
static NaryExpression |
lt(Expression lhs,
Expression rhs)
Returns a
NaryExpression "$lt" expression. |
static NaryExpression |
lte(Expression lhs,
Expression rhs)
Returns a
NaryExpression "$lte" expression. |
static UnaryExpression |
millisecond(Expression expression)
Returns a
UnaryExpression "$millisecond" expression. |
static UnaryExpression |
minute(Expression expression)
Returns a
UnaryExpression "$minute" expression. |
static NaryExpression |
mod(Expression numerator,
Expression denominator)
Returns a
NaryExpression "$mod" expression. |
static UnaryExpression |
month(Expression expression)
Returns a
UnaryExpression "$month" expression. |
static NaryExpression |
multiply(Expression lhs,
Expression rhs)
Returns a
NaryExpression "$multiply" expression. |
static NaryExpression |
ne(Expression lhs,
Expression rhs)
Returns a
NaryExpression "$ne" expression. |
static UnaryExpression |
not(Expression expression)
Returns a
UnaryExpression "$not" expression. |
static Constant |
nullConstant()
Returns a
null Constant expression. |
static NaryExpression |
or(Expression... expressions)
Returns an
NaryExpression "$or" expression. |
static UnaryExpression |
second(Expression expression)
Returns a
UnaryExpression "$second" expression. |
static Element |
set(String name,
DocumentAssignable document)
Returns an element to set the value to.
|
static Element |
set(String name,
Expression expression)
Returns an element to set the value to.
|
static NaryExpression |
strcasecmp(Expression lhs,
Expression rhs)
Returns a
NaryExpression
"$strcasecmp" expression. |
static NaryExpression |
substr(Expression string,
Expression skip,
Expression length)
Returns a
NaryExpression "$substr" expression. |
static NaryExpression |
subtract(Expression lhs,
Expression rhs)
Returns a
NaryExpression "$subtract" expression. |
static UnaryExpression |
toLower(Expression string)
Returns a
UnaryExpression "$toLower" expression. |
static UnaryExpression |
toUpper(Expression string)
Returns a
UnaryExpression "$toUpper" expression. |
static UnaryExpression |
week(Expression expression)
Returns a
UnaryExpression "$week" expression. |
static UnaryExpression |
year(Expression expression)
Returns a
UnaryExpression "$year" expression. |
public static final String ADD
public static final String AND
public static final String COMPARE
public static final String CONCATENATE
public static final String CONDITION
public static final String DAY_OF_MONTH
public static final String DAY_OF_WEEK
public static final String DAY_OF_YEAR
public static final String DIVIDE
public static final String EQUAL
public static final String GREATER_THAN
public static final String GREATER_THAN_OR_EQUAL
public static final String HOUR
public static final String IF_NULL
public static final String LESS_THAN
public static final String LESS_THAN_OR_EQUAL
public static final String MILLISECOND
public static final String MINUTE
public static final String MODULO
public static final String MONTH
public static final String MULTIPLY
public static final String NOT
public static final String NOT_EQUAL
public static final String OR
public static final String SECOND
public static final String STRING_CASE_INSENSITIVE_COMPARE
public static final String SUB_STRING
public static final String SUBTRACT
public static final String TO_LOWER
public static final String TO_UPPER
public static final String WEEK
public static final String YEAR
public static NaryExpression add(Expression... expressions)
NaryExpression
"$add" expression.expressions
- The sub-expressions.NaryExpression
"$add" expression.public static NaryExpression and(Expression... expressions)
NaryExpression
"$and" expression.expressions
- The sub-expressions.NaryExpression
"$and" expression.public static NaryExpression cmp(Expression lhs, Expression rhs)
NaryExpression
"$cmp" expression.lhs
- The left hand side of the operation.rhs
- The left hand side of the operation.NaryExpression
"$cmp" expression.public static NaryExpression concatenate(Expression... expression)
NaryExpression
"$concat" expression.expression
- The string expressions for the operator.NaryExpression
"$concat" expression.public static NaryExpression cond(Expression test, Expression trueResult, Expression falseResult)
NaryExpression
"$cond" expression.test
- The conditions test.trueResult
- The result if the test is true.falseResult
- The result if the test is false.NaryExpression
"$cond" expression.public static Constant constant(boolean value)
Constant
expression with the provided value.value
- The constants value.Constant
expression.public static Constant constant(Date value)
Constant
expression with the provided value.value
- The constants value.Constant
expression.public static Constant constant(double value)
Constant
expression with the provided value.value
- The constants value.Constant
expression.public static Constant constant(int value)
Constant
expression with the provided value.value
- The constants value.Constant
expression.public static Constant constant(long value)
Constant
expression with the provided value.value
- The constants value.Constant
expression.public static Constant constant(ObjectId value)
Constant
expression with the provided value.value
- The constants value.Constant
expression.public static Constant constant(Pattern value)
Constant
expression with the provided value.value
- The constants value.Constant
expression.public static Constant constant(String value)
Constant
expression with the provided value.value
- The constants value.Constant
expression.public static Constant constantMongoTimestamp(long value)
Constant
expression with the provided value.value
- The constants value.Constant
expression.public static Constant constantTimestamp(long value)
Constant
expression with the provided value.value
- The constants value.Constant
expression.public static UnaryExpression dayOfMonth(Expression expression)
UnaryExpression
"$dayOfMonth" expression.expression
- The date for the operator.UnaryExpression
"$dayOfMonth" expression.public static UnaryExpression dayOfWeek(Expression expression)
UnaryExpression
"$dayOfWeek" expression.expression
- The date for the operator.UnaryExpression
"$dayOfWeek" expression.public static UnaryExpression dayOfYear(Expression expression)
UnaryExpression
"$dayOfYear" expression.expression
- The date for the operator.UnaryExpression
"$dayOfYear" expression.public static NaryExpression divide(Expression numerator, Expression denominator)
NaryExpression
"$divide" expression.numerator
- The numerator of the division.denominator
- The denominator of the division.NaryExpression
"$divide" expression.public static NaryExpression eq(Expression lhs, Expression rhs)
NaryExpression
"$eq" expression.lhs
- The left hand side of the equals.rhs
- The right hand side of the equals.NaryExpression
"$eq" expression.public static Constant field(String value)
Constant
expression with the provided value.value
- The constants value.Constant
expression.public static NaryExpression gt(Expression lhs, Expression rhs)
NaryExpression
"$gt" expression.lhs
- The left hand side of the comparison.rhs
- The right hand side of the comparison.NaryExpression
"$gt" expression.public static NaryExpression gte(Expression lhs, Expression rhs)
NaryExpression
"$gte"
expression.lhs
- The left hand side of the comparison.rhs
- The right hand side of the comparison.NaryExpression
"$gte"
expression.public static UnaryExpression hour(Expression expression)
UnaryExpression
"$hour" expression.expression
- The date for the operator.UnaryExpression
"$hour" expression.public static NaryExpression ifNull(Expression first, Expression second)
NaryExpression
"$ifNull" expression.first
- The first expression.second
- The second expression.NaryExpression
"$ifNull" expression.public static NaryExpression lt(Expression lhs, Expression rhs)
NaryExpression
"$lt" expression.lhs
- The left hand side of the comparison.rhs
- The right hand side of the comparison.NaryExpression
"$lt" expression.public static NaryExpression lte(Expression lhs, Expression rhs)
NaryExpression
"$lte" expression.lhs
- The left hand side of the comparison.rhs
- The right hand side of the comparison.NaryExpression
"$lt" expression.public static UnaryExpression millisecond(Expression expression)
UnaryExpression
"$millisecond" expression.expression
- The date for the operator.UnaryExpression
"$millisecond" expression.public static UnaryExpression minute(Expression expression)
UnaryExpression
"$minute" expression.expression
- The date for the operator.UnaryExpression
"$minute" expression.public static NaryExpression mod(Expression numerator, Expression denominator)
NaryExpression
"$mod" expression.numerator
- The numerator of the modulo operation.denominator
- The denominator of the modulo operation.NaryExpression
"$mod" expression.public static UnaryExpression month(Expression expression)
UnaryExpression
"$month" expression.expression
- The date for the operator.UnaryExpression
"$month" expression.public static NaryExpression multiply(Expression lhs, Expression rhs)
NaryExpression
"$multiply" expression.lhs
- The left hand side of the operator.rhs
- The right hand side of the operator.NaryExpression
"$multiply" expression.public static NaryExpression ne(Expression lhs, Expression rhs)
NaryExpression
"$ne" expression.lhs
- The left hand side of the comparison.rhs
- The right hand side of the comparison.NaryExpression
"$ne" expression.public static UnaryExpression not(Expression expression)
UnaryExpression
"$not" expression.expression
- The sub expressions for the $not.UnaryExpression
"$not" expression.public static Constant nullConstant()
null
Constant
expression.Constant
expression.public static NaryExpression or(Expression... expressions)
NaryExpression
"$or" expression.expressions
- The sub-expressions.NaryExpression
"$or" expression.public static UnaryExpression second(Expression expression)
UnaryExpression
"$second" expression.expression
- The date for the operator.UnaryExpression
"$second" expression.public static Element set(String name, DocumentAssignable document)
name
- The name of the field to set.document
- The document to set the document to.public static Element set(String name, Expression expression)
name
- The name of the field to set.expression
- The expression to compute the value for the field.public static NaryExpression strcasecmp(Expression lhs, Expression rhs)
NaryExpression
"$strcasecmp" expression.lhs
- The left hand side of the comparison.rhs
- The right hand side of the comparison.NaryExpression
"$strcasecmp" expression.public static NaryExpression substr(Expression string, Expression skip, Expression length)
NaryExpression
"$substr" expression.string
- The string to pull a sub-string from.skip
- The number of characters to skip in the string.length
- The length of the string to extract.NaryExpression
"$substr" expression.public static NaryExpression subtract(Expression lhs, Expression rhs)
NaryExpression
"$subtract" expression.lhs
- The left hand side of the operator.rhs
- The right hand side of the operator.NaryExpression
"$subtract" expression.public static UnaryExpression toLower(Expression string)
UnaryExpression
"$toLower" expression.string
- The string to modify.UnaryExpression
"$toLower" expression.public static UnaryExpression toUpper(Expression string)
UnaryExpression
"$toUpper" expression.string
- The string to modify.UnaryExpression
"$toUpper" expression.public static UnaryExpression week(Expression expression)
UnaryExpression
"$week" expression.expression
- The date for the operator.UnaryExpression
"$week" expression.public static UnaryExpression year(Expression expression)
UnaryExpression
"$year" expression.expression
- The date for the operator.UnaryExpression
"$year" expression.Copyright © 2011-2013 Allanbank Consulting, Inc.. All Rights Reserved.