|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.io.Marshalled<T>
public final class Marshalled<T>
Encapsulates lazy Object and byte array forms accessible via corresponding get methods.
Conversion from byte array to object is perfromed lazily and results of conversion are cached.
This object is not serializable by itself, but IOUtil.objectToBytes(Object)
and
IOUtil.writeObject(DataOutput, Object)
methods understand this object and use the result of
getBytes()
invocation.
Method Summary | ||
---|---|---|
boolean |
equals(Object obj)
|
|
static
|
forBytes(byte[] bytes)
|
|
static
|
forObject(T object)
|
|
byte[] |
getBytes()
Returns byte array representation of this marshalled object. |
|
T |
getObject()
Returns object representation of this marshalled object. |
|
T |
getObject(ClassLoader cl)
Returns object representation of this marshalled object. |
|
int |
hashCode()
|
|
String |
toString()
|
|
static Object |
unwrap(Object object)
Unwraps Marshalled argument via getObject() call or returns object unmodified. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static Object unwrap(Object object)
Marshalled
argument via getObject()
call or returns object unmodified.
public static <T> Marshalled<T> forObject(T object)
public static <T> Marshalled<T> forBytes(byte[] bytes)
public T getObject()
MarshallingException
- if object cannot be deserialized from its byte arraypublic T getObject(ClassLoader cl)
cl
- the ClassLoader that will be used to load classes; null
for default
MarshallingException
- if object cannot be deserialized from its byte arraypublic byte[] getBytes()
MarshallingException
- if object cannot be serialized to byte arraypublic boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |