Class MarshallableObject<T>
java.lang.Object
org.infinispan.marshall.protostream.impl.MarshallableObject<T>
A wrapper for interface implementations which can either be marshalled by the
GlobalMarshaller or the configured user marshaller if no internal marshaller exists for
the implementation. In such scenarios it's not possible to use WrappedMessage as
it will ignore any configured user marshaller, and similarly, it's not possible to use MarshallableUserObject
as that exclusively utilises the user marshaller.
A good example of when this class is required, is for the marshalling of Metadata implementations. We utilise
many internal implementations, which always have a ProtoStream marshaller available; however, it's also possible for
users to provide custom implementations which must be handled by the configured user marshaller.
- Since:
- 16.0
- Author:
- Ryan Emerson
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
object
-
-
Constructor Details
-
MarshallableObject
-
-
Method Details
-
create
- Parameters:
object- the Object to be wrapped.- Returns:
- a new
MarshallableObjectinstance containing the passed object if the object is not null, otherwise null.
-
unwrap
- Parameters:
wrapper- theMarshallableObjectinstance to unwrap.- Returns:
- the wrapped
Objector null if the provided wrapper does not exist.
-
get
-
equals
-
hashCode
-
size
public static int size(int objectBytes) -
toString
-