Class MarshallableUserObject<T>

java.lang.Object
org.infinispan.marshall.protostream.impl.MarshallableUserObject<T>

@ProtoTypeId(2) public class MarshallableUserObject<T> extends Object
A wrapper message used by ProtoStream Marshallers to allow user objects to be marshalled/unmarshalled via the MarshallableUserObject.Marshaller implementation, which delegates to the configured user marshaller in SerializationConfiguration if it exists.

This abstraction hides the details of the configured user marshaller from our internal Pojos, so that all calls to the configured user marshaller can be limited to the MarshallableUserObject.Marshaller instance.

In order to allow this object to be utilised by our internal ProtoStream annotated Pojos, we need to generate the proto schema for this object using the protostream-processor and AutoProtoSchemaBuilder. Consequently, it's necessary for the generated marshaller to be overridden, therefore calls to SerializationContext.registerMarshaller(BaseMarshaller) must be made after the registration of any generated SerializationContextInitializer's that contain this class. To ensure that the marshaller generated for this class is never used, we throw a IllegalStateException if the ProtoFactory constructor is called.

Since:
10.0
Author:
Ryan Emerson
  • Constructor Details

    • MarshallableUserObject

      public MarshallableUserObject(T object)
  • Method Details

    • get

      public T get()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • size

      public static int size(int objectBytes)