Answer the question
In order to leave comments, you need to log in
Gson doesn't serialize methods?
I have an object, there is a getter. I would like gson to serialize it. After reading the documentation, I realized that this is not possible. Is it so?
Answer the question
In order to leave comments, you need to log in
The best way is to write a Serializer and do it manually there.
Data is serialized, not methods. Those. in some form, the state (data) of an object is stored, and then it can be loaded into an object of the same class. It is the class that will define the methods (behavior). In this case, the class must be known in the application in which the deserialization is performed, and the SerialVersionUID must match what the object class had during serialization.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question