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

Makes the wrap type adapter factory single class #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

julman99
Copy link
Owner

@julman99 julman99 commented Mar 4, 2016

@andressanchez please review this change to your pull request #27

I think it makes it more natural to the Gson standards and we dont need to do the loop to get the parent classes

builder.registerTypeAdapterFactory(new WrapTypeAdapterFactory(wrappedClasses));

for(Map.Entry<Class, Mapper> wrappedEntries: wrappedClasses.entrySet()) {
builder.registerTypeAdapterFactory(new WrapTypeAdapterFactory(wrappedEntries.getKey(), wrappedEntries.getValue()));
Copy link
Contributor

Choose a reason for hiding this comment

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

My only concern here is that if you register two wrappers, one for Animal and another one for Cat, you should be aware that it will wrap with the first registered. Apart from that, looks good to me.

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