Class Criteria
java.lang.Object
com.jayway.jsonpath.Criteria
- All Implemented Interfaces:
Predicate
-
Nested Class Summary
Nested classes/interfaces inherited from interface Predicate
Predicate.PredicateContext -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThealloperator 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) Thealloperator 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 keybooleanprivate voidThecontainsoperator asserts that the provided object is contained in the result.static CriteriaDeprecated.empty(boolean empty) ThenotEmptyoperator 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 >= operatorTheinoperator is analogous to the SQL IN modifier, allowing you to specify an array of possible matches.in(Collection<?> c) Theinoperator 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 <= operatorThematchesoperator checks that an object matches the given predicate.Creates a criterion using the != operatorTheninoperator 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) Theninoperator 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 CriteriaDeprecated.private static StringprefixPath(String key) Creates a criterion using a Regexsize(int size) Thesizeoperator matches:private Collection<RelationalExpressionNode> toString()The $type operator matches values based on their Java JSON type.static CriteriaDeprecated.static CriteriaStatic 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
-
and
-
is
-
eq
-
ne
-
lt
-
lte
-
gt
-
gte
-
regex
-
in
-
in
Theinoperator 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
-
nin
-
nin
Theninoperator 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
-
all
Thealloperator 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
Thesizeoperator matches:- array with the specified number of elements.
- string with given length.
- Parameters:
size-- Returns:
- the criteria
-
type
-
exists
Check for existence (or lack thereof) of a field.- Parameters:
shouldExist-- Returns:
- the criteria
-
notEmpty
Deprecated.ThenotEmptyoperator checks that an array or String is not empty.- Returns:
- the criteria
-
empty
ThenotEmptyoperator checks that an array or String is empty.- Parameters:
empty- should be empty- Returns:
- the criteria
-
matches
-
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()
-