public class Criteria extends Object implements CriteriaDefinition
| Modifier | Constructor and Description |
|---|---|
|
Criteria() |
protected |
Criteria(List<Criteria> criteriaChain,
String key) |
|
Criteria(String key) |
| Modifier and Type | Method and Description |
|---|---|
Criteria |
all(Collection<?> o)
Creates a criterion using the $all operator.
|
Criteria |
all(Object... o)
Creates a criterion using the $all operator.
|
Criteria |
and(String key)
Static factory method to create a Criteria using the provided key
|
Criteria |
andOperator(Criteria... criteria)
Creates an 'and' criteria using the $and operator for all of the provided criteria.
|
Criteria |
elemMatch(Criteria c)
Creates a criterion using the $elemMatch operator
|
boolean |
equals(Object obj) |
Criteria |
exists(boolean b)
Creates a criterion using the $exists operator.
|
com.mongodb.DBObject |
getCriteriaObject()
Get
DBObject representation. |
String |
getKey()
Get the identifying key.
|
protected com.mongodb.DBObject |
getSingleCriteriaObject() |
Criteria |
gt(Object o)
Creates a criterion using the $gt operator.
|
Criteria |
gte(Object o)
Creates a criterion using the $gte operator.
|
int |
hashCode() |
Criteria |
in(Collection<?> c)
Creates a criterion using the $in operator.
|
Criteria |
in(Object... o)
Creates a criterion using the $in operator.
|
Criteria |
is(Object o)
Creates a criterion using equality
|
Criteria |
lt(Object o)
Creates a criterion using the $lt operator.
|
Criteria |
lte(Object o)
Creates a criterion using the $lte operator.
|
Criteria |
maxDistance(double maxDistance)
Creates a geospatical criterion using a $maxDistance operation, for use with $near
|
Criteria |
mod(Number value,
Number remainder)
Creates a criterion using the $mod operator.
|
Criteria |
ne(Object o)
Creates a criterion using the $ne operator.
|
Criteria |
near(Point point)
Creates a geospatial criterion using a $near operation.
|
Criteria |
nearSphere(Point point)
Creates a geospatial criterion using a $nearSphere operation.
|
Criteria |
nin(Collection<?> o)
Creates a criterion using the $nin operator.
|
Criteria |
nin(Object... o)
Creates a criterion using the $nin operator.
|
Criteria |
norOperator(Criteria... criteria)
Creates a 'nor' criteria using the $nor operator for all of the provided criteria.
|
Criteria |
not()
Creates a criterion using the $not meta operator which affects the clause directly following
|
Criteria |
orOperator(Criteria... criteria)
Creates an 'or' criteria using the $or operator for all of the provided criteria
Note that mongodb doesn't support an $or operator to be wrapped in a $not operator.
|
Criteria |
regex(Pattern pattern)
Syntactical sugar for
is(Object) making obvious that we create a regex predicate. |
Criteria |
regex(String re)
Creates a criterion using a $regex operator.
|
Criteria |
regex(String re,
String options)
Creates a criterion using a $regex and $options operator.
|
Criteria |
size(int s)
Creates a criterion using the $size operator.
|
Criteria |
type(int t)
Creates a criterion using the $type operator.
|
static Criteria |
where(String key)
Static factory method to create a Criteria using the provided key
|
Criteria |
within(Shape shape)
Creates a geospatial criterion using a $within operation.
|
Criteria |
withinSphere(Circle circle)
Creates a geospatial criterion using a $within $centerSphere operation.
|
public Criteria()
public Criteria(String key)
public static Criteria where(String key)
key - public Criteria and(String key)
public Criteria ne(Object o)
o - http://docs.mongodb.org/manual/reference/operator/query/ne/public Criteria lt(Object o)
o - http://docs.mongodb.org/manual/reference/operator/query/lt/public Criteria lte(Object o)
o - http://docs.mongodb.org/manual/reference/operator/query/lte/public Criteria gt(Object o)
o - http://docs.mongodb.org/manual/reference/operator/query/gt/public Criteria gte(Object o)
o - http://docs.mongodb.org/manual/reference/operator/query/gte/public Criteria in(Object... o)
o - the values to match againsthttp://docs.mongodb.org/manual/reference/operator/query/in/public Criteria in(Collection<?> c)
c - the collection containing the values to match againsthttp://docs.mongodb.org/manual/reference/operator/query/in/public Criteria nin(Object... o)
o - http://docs.mongodb.org/manual/reference/operator/query/nin/public Criteria nin(Collection<?> o)
o - http://docs.mongodb.org/manual/reference/operator/query/nin/public Criteria mod(Number value, Number remainder)
value - remainder - http://docs.mongodb.org/manual/reference/operator/query/mod/public Criteria all(Object... o)
o - http://docs.mongodb.org/manual/reference/operator/query/all/public Criteria all(Collection<?> o)
o - http://docs.mongodb.org/manual/reference/operator/query/all/public Criteria size(int s)
s - http://docs.mongodb.org/manual/reference/operator/query/size/public Criteria exists(boolean b)
b - http://docs.mongodb.org/manual/reference/operator/query/exists/public Criteria type(int t)
t - http://docs.mongodb.org/manual/reference/operator/query/type/public Criteria not()
http://docs.mongodb.org/manual/reference/operator/query/not/public Criteria regex(String re)
re - http://docs.mongodb.org/manual/reference/operator/query/regex/public Criteria regex(String re, String options)
re - options - http://docs.mongodb.org/manual/reference/operator/query/regex/,
http://docs.mongodb.org/manual/reference/operator/query/regex/#op._S_optionspublic Criteria regex(Pattern pattern)
is(Object) making obvious that we create a regex predicate.pattern - public Criteria withinSphere(Circle circle)
circle - must not be nullhttp://docs.mongodb.org/manual/reference/operator/query/geoWithin/,
http://docs.mongodb.org/manual/reference/operator/query/centerSphere/public Criteria within(Shape shape)
shape - http://docs.mongodb.org/manual/reference/operator/query/geoWithin/public Criteria near(Point point)
point - must not be nullhttp://docs.mongodb.org/manual/reference/operator/query/near/public Criteria nearSphere(Point point)
point - must not be nullhttp://docs.mongodb.org/manual/reference/operator/query/nearSphere/public Criteria maxDistance(double maxDistance)
maxDistance - http://docs.mongodb.org/manual/reference/operator/query/maxDistance/public Criteria elemMatch(Criteria c)
c - http://docs.mongodb.org/manual/reference/operator/query/elemMatch/public Criteria orOperator(Criteria... criteria)
Note that mongodb doesn't support an $or operator to be wrapped in a $not operator.
criteria - IllegalArgumentException - if orOperator(Criteria...) follows a not() call directly.public Criteria norOperator(Criteria... criteria)
Note that mongodb doesn't support an $nor operator to be wrapped in a $not operator.
criteria - IllegalArgumentException - if norOperator(Criteria...) follows a not() call directly.public Criteria andOperator(Criteria... criteria)
Note that mongodb doesn't support an $and operator to be wrapped in a $not operator.
criteria - IllegalArgumentException - if andOperator(Criteria...) follows a not() call directly.public String getKey()
CriteriaDefinitiongetKey in interface CriteriaDefinitionpublic com.mongodb.DBObject getCriteriaObject()
CriteriaDefinitionDBObject representation.getCriteriaObject in interface CriteriaDefinitionprotected com.mongodb.DBObject getSingleCriteriaObject()
Copyright © 2011-2014–2014 Pivotal Software, Inc.. All rights reserved.