You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Predicate builder over a JSON specification. Specify you query in a JSON format and check it against a given object.
11
+
Specify a predicate in a JSON format and check it against a given object.
13
12
14
13
## Usage
15
14
@@ -25,9 +24,9 @@ Include latest version [ whose field/key called 'name' contains the String 'project':
31
30
```json
32
31
{
33
32
"name": {
@@ -36,19 +35,21 @@ An example of a JSON predicate:
36
35
}
37
36
```
38
37
39
-
Suppose there is a `List<Project>` where each project has a name, the following code will filter only those with `project` in its attribute name.
38
+
Suppose there is a `List<Project>` where each project has a `String:name` attribute, the following code will filter only those with `project` in its attribute 'name'.
In this example, if we provide the filter value using a GUI the underlying Java code remains unchanged.
48
49
49
50
## Predefined constructors
50
51
51
-
The set of build-in operators provided.
52
+
Bellow a list of the built-in provided predicates, you can register you own predicate. Checkout the interface [`IPredicateManager`](https://github.com/thiagolvlsantos/json-predicate/blob/master/src/main/java/io/github/thiagolvlsantos/json/predicate/impl/PredicateManagerDefault.java) implementation.
52
53
53
54
### Logical operators
54
55
@@ -74,7 +75,7 @@ The set of build-in operators provided.
74
75
|$contains or $c |``` {"name": {"$contains": "proj"} }```|
75
76
|$ncontains or $nc |``` {"name": {"$ncontains": "A"} }```|
76
77
|$match or $m |``` {"name": {"$match": "\d{8}"} }```|
77
-
|$nmatch or $nm |``` {"name": {"$nm": "\d{8}"} }```|
78
+
|$nmatch or $nm |``` {"name": {"$nmatch": "\d{8}"} }```|
0 commit comments