-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for immutable and private fields/properties
In addition to better encapsulation and increased safety, this allows LoganSquare to support Kotlin data classes. For each fields, marked for parsing from JSON, there must be a matching constructor parameter in the corresponding position. The names of parameters are not validated, instead the number and types of parameters are relied on for safety. Each model uses either setter/field injection (old behavior) or constructor injection (new behavior); mixing setters and constructor parameters within same model is not supported. Calling `parseField` on JsonMappers of models with constructor injection produces UnsupportedOperationException. The impact on existing code should be minimal — the new parsing strategy gets used only when previous version of LoganSquare would produce an error: e.g. if there are final final or private fields without setters. See pull request for full description of feature
- Loading branch information
1 parent
a063552
commit e300421
Showing
12 changed files
with
535 additions
and
66 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
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
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
Oops, something went wrong.