I think you should define an externalizer with the `@SerializeWith` annotation, or even an `AdvancedExternalizer` like in `org.infinispan.tree.LifecycleCallbacks`.