Class SerializeUtility



  • public final class SerializeUtility
    extends java.lang.Object
    Utility providing useful serialization methods.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.io.Serializable toSerializable​(java.lang.Object aObject)
      Converts instances of common non-serializable types such as Iterator and ListIterator into serializable instances.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toSerializable

        public static java.io.Serializable toSerializable​(java.lang.Object aObject)
        Converts instances of common non-serializable types such as Iterator and ListIterator into serializable instances. Testing for the Serializable interface is not sufficient to determine whether an instance is serializable as of the special handling of the Serializable tag interface in the JVM. Though in case the type of the instance is not tagged with the Serializable interface, then null 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 the Serializable interface, then null is returned.