Predicate.PredicateContext
Modifier and Type | Method and Description |
---|---|
Criteria |
all(Collection<?> c)
The
all operator is similar to $in, but instead of matching any value
in the specified array all values in the array must be matched. |
Criteria |
all(Object... o)
The
all operator is similar to $in, but instead of matching any value
in the specified array all values in the array must be matched. |
Criteria |
and(String key)
Static factory method to create a Criteria using the provided key
|
boolean |
apply(Predicate.PredicateContext ctx) |
Criteria |
contains(Object o)
The
contains operator asserts that the provided object is contained
in the result. |
static Criteria |
create(String left,
String operator,
String right)
Deprecated.
|
Criteria |
empty(boolean empty)
The
notEmpty operator checks that an array or String is empty. |
Criteria |
eq(Object o)
Creates a criterion using equality
|
Criteria |
exists(boolean shouldExist)
Check for existence (or lack thereof) of a field.
|
Criteria |
gt(Object o)
Creates a criterion using the > operator
|
Criteria |
gte(Object o)
Creates a criterion using the >= operator
|
Criteria |
in(Collection<?> c)
The
in operator is analogous to the SQL IN modifier, allowing you
to specify an array of possible matches. |
Criteria |
in(Object... o)
The
in operator is analogous to the SQL IN modifier, allowing you
to specify an array of possible matches. |
Criteria |
is(Object o)
Creates a criterion using equality
|
Criteria |
lt(Object o)
Creates a criterion using the < operator
|
Criteria |
lte(Object o)
Creates a criterion using the <= operator
|
Criteria |
matches(Predicate p)
The
matches operator checks that an object matches the given predicate. |
Criteria |
ne(Object o)
Creates a criterion using the != operator
|
Criteria |
nin(Collection<?> c)
The
nin operator is similar to $in except that it selects objects for
which the specified field does not have any value in the specified array. |
Criteria |
nin(Object... o)
The
nin operator is similar to $in except that it selects objects for
which the specified field does not have any value in the specified array. |
Criteria |
notEmpty()
Deprecated.
|
static Criteria |
parse(String criteria)
Deprecated.
|
Criteria |
regex(Pattern pattern)
Creates a criterion using a Regex
|
Criteria |
size(int size)
The
size operator matches:
array with the specified number of elements.
string with given length.
|
String |
toString() |
Criteria |
type(Class<?> clazz)
The $type operator matches values based on their Java JSON type.
|
static Criteria |
where(Path key)
Deprecated.
|
static Criteria |
where(String key)
Static factory method to create a Criteria using the provided key
|
public boolean apply(Predicate.PredicateContext ctx)
@Deprecated public static Criteria where(Path key)
key
- filed namepublic static Criteria where(String key)
key
- filed namepublic Criteria and(String key)
key
- ads new filed to criteriapublic Criteria is(Object o)
o
- public Criteria eq(Object o)
o
- public Criteria ne(Object o)
o
- public Criteria lt(Object o)
o
- public Criteria lte(Object o)
o
- public Criteria gt(Object o)
o
- public Criteria gte(Object o)
o
- public Criteria regex(Pattern pattern)
pattern
- public Criteria in(Object... o)
in
operator is analogous to the SQL IN modifier, allowing you
to specify an array of possible matches.o
- the values to match againstpublic Criteria in(Collection<?> c)
in
operator is analogous to the SQL IN modifier, allowing you
to specify an array of possible matches.c
- the collection containing the values to match againstpublic Criteria contains(Object o)
contains
operator asserts that the provided object is contained
in the result. The object that should contain the input can be either an object or a String.o
- that should exists in given collection orpublic Criteria nin(Object... o)
nin
operator is similar to $in except that it selects objects for
which the specified field does not have any value in the specified array.o
- the values to match againstpublic Criteria nin(Collection<?> c)
nin
operator is similar to $in except that it selects objects for
which the specified field does not have any value in the specified array.c
- the values to match againstpublic Criteria all(Object... o)
all
operator is similar to $in, but instead of matching any value
in the specified array all values in the array must be matched.o
- public Criteria all(Collection<?> c)
all
operator is similar to $in, but instead of matching any value
in the specified array all values in the array must be matched.c
- public Criteria size(int size)
size
operator matches:
size
- public Criteria type(Class<?> clazz)
clazz
- public Criteria exists(boolean shouldExist)
shouldExist
- @Deprecated public Criteria notEmpty()
notEmpty
operator checks that an array or String is not empty.public Criteria empty(boolean empty)
notEmpty
operator checks that an array or String is empty.empty
- should be emptypublic Criteria matches(Predicate p)
matches
operator checks that an object matches the given predicate.p
- @Deprecated public static Criteria parse(String criteria)
Filter.parse(String)
criteria
- @Deprecated public static Criteria create(String left, String operator, String right)
left
- path to evaluate in criteriaoperator
- operatorright
- expected valueCopyright © 2018. All rights reserved.