Package com.jayway.jsonpath
Class Criteria
java.lang.Object
com.jayway.jsonpath.Criteria
- All Implemented Interfaces:
Predicate
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jayway.jsonpath.Predicate
Predicate.PredicateContext
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionTheall
operator is similar to $in, but instead of matching any value in the specified array all values in the array must be matched.all
(Collection<?> c) Theall
operator is similar to $in, but instead of matching any value in the specified array all values in the array must be matched.Static factory method to create a Criteria using the provided keyboolean
private void
Thecontains
operator asserts that the provided object is contained in the result.static Criteria
Deprecated.empty
(boolean empty) ThenotEmpty
operator checks that an array or String is empty.Creates a criterion using equalityexists
(boolean shouldExist) Check for existence (or lack thereof) of a field.Creates a criterion using the > operatorCreates a criterion using the >= operatorThein
operator is analogous to the SQL IN modifier, allowing you to specify an array of possible matches.in
(Collection<?> c) Thein
operator is analogous to the SQL IN modifier, allowing you to specify an array of possible matches.Creates a criterion using equalityCreates a criterion using the < operatorCreates a criterion using the <= operatorThematches
operator checks that an object matches the given predicate.Creates a criterion using the != operatorThenin
operator is similar to $in except that it selects objects for which the specified field does not have any value in the specified array.nin
(Collection<?> c) Thenin
operator is similar to $in except that it selects objects for which the specified field does not have any value in the specified array.notEmpty()
Deprecated.static Criteria
Deprecated.private static String
prefixPath
(String key) Creates a criterion using a Regexsize
(int size) Thesize
operator matches:private Collection
<RelationalExpressionNode> toString()
The $type operator matches values based on their Java JSON type.static Criteria
Deprecated.static Criteria
Static factory method to create a Criteria using the provided key
-
Field Details
-
criteriaChain
-
left
-
criteriaType
-
right
-
-
Constructor Details
-
Criteria
-
Criteria
-
-
Method Details
-
apply
-
toString
-
toRelationalExpressionNodes
-
where
Deprecated.Static factory method to create a Criteria using the provided key- Parameters:
key
- filed name- Returns:
- the new criteria
-
where
Static factory method to create a Criteria using the provided key- Parameters:
key
- filed name- Returns:
- the new criteria
-
and
Static factory method to create a Criteria using the provided key- Parameters:
key
- ads new filed to criteria- Returns:
- the criteria builder
-
is
Creates a criterion using equality- Parameters:
o
-- Returns:
- the criteria
-
eq
Creates a criterion using equality- Parameters:
o
-- Returns:
- the criteria
-
ne
Creates a criterion using the != operator- Parameters:
o
-- Returns:
- the criteria
-
lt
Creates a criterion using the < operator- Parameters:
o
-- Returns:
- the criteria
-
lte
Creates a criterion using the <= operator- Parameters:
o
-- Returns:
- the criteria
-
gt
Creates a criterion using the > operator- Parameters:
o
-- Returns:
- the criteria
-
gte
Creates a criterion using the >= operator- Parameters:
o
-- Returns:
- the criteria
-
regex
Creates a criterion using a Regex- Parameters:
pattern
-- Returns:
- the criteria
-
in
Thein
operator is analogous to the SQL IN modifier, allowing you to specify an array of possible matches.- Parameters:
o
- the values to match against- Returns:
- the criteria
-
in
Thein
operator is analogous to the SQL IN modifier, allowing you to specify an array of possible matches.- Parameters:
c
- the collection containing the values to match against- Returns:
- the criteria
-
contains
Thecontains
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.- Parameters:
o
- that should exists in given collection or- Returns:
- the criteria
-
nin
Thenin
operator is similar to $in except that it selects objects for which the specified field does not have any value in the specified array.- Parameters:
o
- the values to match against- Returns:
- the criteria
-
nin
Thenin
operator is similar to $in except that it selects objects for which the specified field does not have any value in the specified array.- Parameters:
c
- the values to match against- Returns:
- the criteria
-
all
Theall
operator is similar to $in, but instead of matching any value in the specified array all values in the array must be matched.- Parameters:
o
-- Returns:
- the criteria
-
all
Theall
operator is similar to $in, but instead of matching any value in the specified array all values in the array must be matched.- Parameters:
c
-- Returns:
- the criteria
-
size
Thesize
operator matches:- array with the specified number of elements.
- string with given length.
- Parameters:
size
-- Returns:
- the criteria
-
type
The $type operator matches values based on their Java JSON type. Supported types are: List.class Map.class String.class Number.class Boolean.class Other types evaluates to false- Parameters:
clazz
-- Returns:
- the criteria
-
exists
Check for existence (or lack thereof) of a field.- Parameters:
shouldExist
-- Returns:
- the criteria
-
notEmpty
Deprecated.ThenotEmpty
operator checks that an array or String is not empty.- Returns:
- the criteria
-
empty
ThenotEmpty
operator checks that an array or String is empty.- Parameters:
empty
- should be empty- Returns:
- the criteria
-
matches
Thematches
operator checks that an object matches the given predicate.- Parameters:
p
-- Returns:
- the criteria
-
parse
Deprecated.Parse the provided criteria Deprecated useFilter.parse(String)
- Parameters:
criteria
-- Returns:
- a criteria
-
create
Deprecated.Creates a new criteria- Parameters:
left
- path to evaluate in criteriaoperator
- operatorright
- expected value- Returns:
- a new Criteria
-
prefixPath
-
checkComplete
private void checkComplete()
-