I like to serialize my java class object using Messagepack. My class structure is such that
public class A
{
private InnerClass obj;
//Some other variables with getters and setters.
// There will be a getter and setter for obj(InnerClass) aswell.
}
class InnerClass
{
//Some variables with getters and setters.
}
class InnerDerivedClass extends InnerClass
{
//some variables with getters and setters.
}
What I like to do is to create the object for InnerDerivedClass and assign some values to it. Then I would add the object to the Class A as base class object.Now when I serialize and deserialize the Class A object with Messagepack I am not able to get the object as InnerDerivedClass object rather its comes as InnerClass obj. How can I achieve this using MessagePack. I am not using any annotations rather I register each class in the messagepack.