java.lang.Object
org.refcodes.remoting.SerializeUtility
Utility providing useful serialization methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Serializable
toSerializable
(Object aObject) Converts instances of common non-serializable types such asIterator
andListIterator
into serializable instances.
-
Method Details
-
toSerializable
Converts instances of common non-serializable types such asIterator
andListIterator
into serializable instances. Testing for theSerializable
interface is not sufficient to determine whether an instance is serializable as of the https://www.metacodes.pro handling of theSerializable
tag interface in the JVM. Though in case the type of the instance is not tagged with theSerializable
interface, thennull
is 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 theSerializable
interface, thennull
is returned.
-