Reputation: 9492
Hello I have a following questions. We are using Hazelcast IdentifiedSeializeable. Is it possible to deserialize an object that was serialized as one class for example User and deserialize it as another class AdminUser based on presumption that the two classes have the same fields ?
Upvotes: 0
Views: 139
Reputation: 6094
If you build your factory accordingly and you read elements / fields in the same order they were written - yeah kind of. You only need to be aware that there is one more "small" issue as configurations need to be mostly similar or new nodes cannot join. So you most probably have to add some magic to your factory.
On the other hand why do you want to do this? Isn't it easier to wrap your user entity into a AdminUser instance after deserialization when you figured out it's an AdminUser?
Upvotes: 2