java.lang.Object
org.refcodes.remoting.SerializeUtility
public final class SerializeUtility extends Object
Utility providing useful serialization methods.
-
Method Summary
Modifier and Type Method Description static SerializabletoSerializable(Object aObject)Converts instances of common non-serializable types such asIteratorandListIteratorinto serializable instances.
-
Method Details
-
toSerializable
Converts instances of common non-serializable types such asIteratorandListIteratorinto serializable instances. Testing for theSerializableinterface is not sufficient to determine whether an instance is serializable as of the special handling of theSerializabletag interface in the JVM. Though in case the type of the instance is not tagged with theSerializableinterface, thennullis returned. In case an instance's type provided is not supported by this method, then the instance is returned as is; it might already be serializable.- Parameters:
aObject- The object to be turned into a serializable counterpart. In case it is not identified or supported (it might already be fully serializable), then the instance is returned unmodified.- Returns:
- The serializable counterpart of the provided instance in case the
type is supported by this method or the instance in case it is
Serializable. In case the type of the instance is not tagged with theSerializableinterface, thennullis returned.
-