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) |
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() |
String |
getKey() |
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) |
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
|
Criteria |
regex(String re,
String options)
Creates a criterion using a $regex and $options
|
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) |
Criteria |
withinSphere(Circle circle)
Creates a geospatial criterion using a $within $center operation.
|
public Criteria()
public Criteria(String key)
public static Criteria where(String key)
key - public Criteria and(String key)
public Criteria lte(Object o)
o - public Criteria gte(Object o)
o - public Criteria in(Object... o)
o - the values to match againstpublic Criteria in(Collection<?> c)
c - the collection containing the values to match againstpublic Criteria nin(Object... o)
o - public Criteria nin(Collection<?> o)
public Criteria mod(Number value, Number remainder)
value - remainder - public Criteria all(Object... o)
o - public Criteria all(Collection<?> o)
public Criteria size(int s)
s - public Criteria exists(boolean b)
b - public Criteria type(int t)
t - public Criteria not()
public Criteria regex(String re, String options)
re - options - public Criteria regex(Pattern pattern)
is(Object) making obvious that we create a regex predicate.pattern - public Criteria withinSphere(Circle circle)
circle - must not be nullpublic Criteria near(Point point)
point - must not be nullpublic Criteria nearSphere(Point point)
point - must not be nullpublic Criteria maxDistance(double maxDistance)
maxDistance - public Criteria elemMatch(Criteria c)
c - 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()
public com.mongodb.DBObject getCriteriaObject()
getCriteriaObject in interface CriteriaDefinitionprotected com.mongodb.DBObject getSingleCriteriaObject()
Copyright © 2011-2013-2013 Pivotal. All Rights Reserved.