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

Problem with Generics types #359

Open
piyushGoyal2 opened this issue Sep 23, 2016 · 0 comments
Open

Problem with Generics types #359

piyushGoyal2 opened this issue Sep 23, 2016 · 0 comments

Comments

@piyushGoyal2
Copy link

piyushGoyal2 commented Sep 23, 2016

I have a classic use case of converting a map to JSON. The only catch here is the Map's value is instance of sub classses of an abstract class. Refer to following code:

public Map<String, JsonAbstractClassB> jsonMap;

where JsonAbstractClassB has two different sub classes JsonClassC and JsonClassD.

While setting the object of class C and class D and serializing works perfectly fine. When I deserialize a json back. All I get is instance of JsonAbstractClassB. Boon does not return me the instance of JsonClassC and JsonClassD.

I was referring to the example https://github.com/boonproject/boon/wiki/Boon-JSON-in-five-minutes#subclasses-interfaces-and-abstract-classes

and could see that if the object of abstract classes and sub classes are not wrapped in a collection, they work perfectly fine during deserialization but not when wrapped in collection.

Any help is highly appreciated.

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

No branches or pull requests

1 participant