-
Notifications
You must be signed in to change notification settings - Fork 215
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
Add support for type Map #19
Comments
Sorry, |
Thanks for the feedback. What would you suggest to add that feature? In my
|
Okay. I have never worked on any intellij code so I can't promise anything. Hope to find the time. |
@mpost neither had I… nor could I promise anything. Just give it a whirl and if you come up with something, PR it ;-) Thanks! |
Neither had I before this plugin... The problem is that its not that obvious how to put map into parcel. There are several ways how to do it. The best solution would be to reuse existing serializes to do it and support all possible key/value types. There is a discussion on SO how to do it. http://stackoverflow.com/questions/8254654/how-write-java-util-map-into-parcel-in-a-smart-way What do you think about it? |
In my implementation i knew that both key and value would be of type string so i serialized into lists of String. In general i would think that both key and value have to be of type Parcelable (or Serializable although that is discouraged for performance reasons). |
The solution should be generic. I like this solution becouse already existing ChainSerializerFactory (the same as the one declared in CodeGenerator.java) can be used (I think so).
In such solution it would be possible to reuse serialization implementation of all types already supported by tools - both as key and value. I have a feelint that it may be possible without major refactoring. |
I have the impression that somebody has a good idea on how to implement the map support and just voluntered for the job. 😀 |
Hmm, didn't remember this was here before I implemented what I did. I didn't refactor the ChainSerializerFactory though because, well, there's a lot of custom stuff that needs to be done to get this quite right and didn't feel the need to get it perfect on this run. I'm wondering if we can even do it without a more significant refactor of I have a PR currently up with some |
... ~3.5 years later, any updates?! I was banging my head on the wall for weeks after finally running into this SO question with the exact answer I needed. (TL;DR: This plugin didn't support Map so we have to take care of it ourselves). For future Googlers, replace the
I can finally stop using Serializable. Good riddance. |
While it is already in the TODO list i wanted to raise my voice and mentioned that Map support would be really great. :)
The text was updated successfully, but these errors were encountered: