net.derquinse.common.test
Class SerializabilityTests

java.lang.Object
  extended by net.derquinse.common.test.SerializabilityTests

public final class SerializabilityTests
extends Object

Serializability support methods.

Author:
Andres Rodriguez

Method Summary
static
<T extends Serializable>
T
check(T obj)
          Checks serializability of one object and equality of the provided instance and the deserialized one.
static
<T extends Serializable>
T
check(T obj, boolean equality)
          Checks serializability of one object and (if desired) equality of the provided instance and the deserialized one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

check

public static <T extends Serializable> T check(T obj,
                                               boolean equality)
                                    throws UnableToSerializeException
Checks serializability of one object and (if desired) equality of the provided instance and the deserialized one.

Parameters:
obj - Object to test.
equality - Whether to test for equality.
Returns:
The deserialized instance.
Throws:
UnableToSerializeException
See Also:
EqualityTests#two(Object, Object)}

check

public static <T extends Serializable> T check(T obj)
                                    throws UnableToSerializeException
Checks serializability of one object and equality of the provided instance and the deserialized one.

Parameters:
obj - Object to test.
Returns:
The deserialized instance.
Throws:
UnableToSerializeException
See Also:
EqualityTests#two(Object, Object)}


Copyright © 2012. All Rights Reserved.