-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22bc989
commit af2ae25
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Statham is a Json Mapper (Deserializer) | ||
|
||
Main goal: "Make your own implementations to understand how it works" | ||
|
||
## How to use it | ||
Provide json string: | ||
```json | ||
{ | ||
"firstName": "Andrii", | ||
"lastName": "Petrov", | ||
"email": "apetrov@gmail.com", | ||
"active": true, | ||
"age": 19, | ||
"address": { | ||
"line1": "Kyiv", | ||
"line2": "Lesna" | ||
} | ||
} | ||
``` | ||
Pass json to Statham#jsonToObj method: | ||
```java | ||
User user = new Statham().jsonToObj(json, User.class); | ||
``` | ||
|
||
### Limitations: | ||
As for now there are some limitations: | ||
* avoid using next characters inside json string key or value: `,":{}[]` | ||
* class should have default constuctor (but I guess you can implement you own Hydrator to handle that) |