T
- The type of object contained in the serialized objectpublic class LazyDeserializingObject<T> extends Object
Constructor and Description |
---|
LazyDeserializingObject(SerializedObject<?> serializedObject,
Serializer serializer) |
LazyDeserializingObject(T deserializedObject)
Creates an instance with the given
deserializedObject object instance. |
Modifier and Type | Method and Description |
---|---|
T |
getObject()
De-serializes the object and returns the result.
|
SerializedObject<?> |
getSerializedObject()
Returns the serialized object to deserialize upon request
|
Serializer |
getSerializer()
Returns the serializer to deserialize this object
|
Class<?> |
getType()
Returns the class of the serialized object.
|
boolean |
isDeserialized()
Indicates whether this object has already been deserialized.
|
public LazyDeserializingObject(T deserializedObject)
deserializedObject
object instance. Using this constructor will
ensure that no deserializing is required when invoking the getType()
or getObject()
methods.deserializedObject
- The deserialized object to return on getObject()
public LazyDeserializingObject(SerializedObject<?> serializedObject, Serializer serializer)
serializedObject
- The serialized payload of the messageserializer
- The serializer to deserialize the payload data withUnknownSerializedTypeException
- if the type of the serialized object cannot be resolved to a classpublic Class<?> getType()
public T getObject()
public boolean isDeserialized()
true
, the
getObject()
method is able to return a value without invoking the serializer.public Serializer getSerializer()
public SerializedObject<?> getSerializedObject()
Copyright © 2010-2014. All Rights Reserved.