public abstract class Filter<T> extends Object
String doc = {"items": [{"name" : "john"}, {"name": "bob"}]}
List names = JsonPath.read(doc, "$items[?].name", Filter.filter(Criteria.where("name").is("john"));
Criteria
Modifier and Type | Class and Description |
---|---|
static class |
Filter.FilterAdapter<T> |
Constructor and Description |
---|
Filter() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
accept(T obj)
Check if this filter will accept or reject the given object
|
abstract boolean |
accept(T obj,
Configuration configuration)
Check if this filter will accept or reject the given object
|
abstract Filter |
addCriteria(Criteria criteria)
Adds a new criteria to this filter
|
Object |
doFilter(Iterable<T> filterItems,
Configuration configuration)
Filters the provided list based on this filter configuration
|
static Filter |
filter(Criteria criteria)
Creates a new filter based on given criteria
|
public static Filter filter(Criteria criteria)
criteria
- the filter criteriapublic Object doFilter(Iterable<T> filterItems, Configuration configuration)
filterItems
- items to filterconfiguration
- the json provider configuration that is used to create the result listpublic abstract boolean accept(T obj)
obj
- item to checkpublic abstract boolean accept(T obj, Configuration configuration)
obj
- item to checkconfiguration
- Copyright © 2011–2014. All rights reserved.