Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a generic json mapper for any entity. #183

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Provide a generic json mapper for any entity. #183

wants to merge 3 commits into from

Conversation

sadegh
Copy link

@sadegh sadegh commented Sep 15, 2016

Hi Fernando,

I changed UserEntityJsonMapper to a generic class named EntiityJsonMapper, so I can deserialize any kind of entity.

Hope you like it!

* @throws com.google.gson.JsonSyntaxException if the json string is not a valid json structure.
*/
public UserEntity transformUserEntity(String userJsonResponse) throws JsonSyntaxException {
public T transformUserEntity(String json) throws JsonSyntaxException {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is a generic entity mapper, then I think the naming of this methods should reflect it, they can be transfromFromEntity and transfromFromEntityCollection

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! Good catch!
Just fixed it, thanks.

@sadegh
Copy link
Author

sadegh commented Aug 13, 2017

@android10 Just updated my PR and resolved merge conflicts.
Can you please give me your feedback?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants