Package com.jayway.jsonpath
Class Filter
- java.lang.Object
-
- com.jayway.jsonpath.Filter
-
- All Implemented Interfaces:
Predicate
- Direct Known Subclasses:
Filter.AndFilter
,Filter.OrFilter
,Filter.SingleFilter
,FilterCompiler.CompiledFilter
public abstract class Filter extends java.lang.Object implements Predicate
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Filter.AndFilter
private static class
Filter.OrFilter
private static class
Filter.SingleFilter
-
Nested classes/interfaces inherited from interface com.jayway.jsonpath.Predicate
Predicate.PredicateContext
-
-
Constructor Summary
Constructors Constructor Description Filter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Filter
and(Predicate other)
abstract boolean
apply(Predicate.PredicateContext ctx)
static Filter
filter(Predicate predicate)
Creates a new Filter based on given criteriastatic Filter
filter(java.util.Collection<Predicate> predicates)
Create a new Filter based on given list of criteria.Filter
or(Predicate other)
static Filter
parse(java.lang.String filter)
Parses a filter.
-
-
-
Method Detail
-
filter
public static Filter filter(Predicate predicate)
Creates a new Filter based on given criteria- Parameters:
predicate
- criteria- Returns:
- a new Filter
-
filter
public static Filter filter(java.util.Collection<Predicate> predicates)
Create a new Filter based on given list of criteria.- Parameters:
predicates
- list of criteria all needs to evaluate to true- Returns:
-
apply
public abstract boolean apply(Predicate.PredicateContext ctx)
-
parse
public static Filter parse(java.lang.String filter)
Parses a filter. The filter must match[?(
, white spaces are ignored.)] - Parameters:
filter
- filter string to parse- Returns:
- the filter
-
-