Class Serial


  • public class Serial
    extends java.lang.Object
    Created by IntelliJ IDEA. User: csr Date: Mar 4, 2005 Time: 2:26:06 PM To change this template use File | Settings | File Templates.
    • Constructor Summary

      Constructors 
      Constructor Description
      Serial()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T extends java.io.Serializable>
      void
      assertTransientFieldsInitialized​(T obj, java.lang.String... excludedFields)
      Check that transient fields are properly initialized after the object has been serialized and deserialized.
      static <T extends java.io.Serializable>
      T
      serial​(T input_object)
      Serializes an Object, deserializes it, and then returns it.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • serial

        public static <T extends java.io.Serializable> T serial​(T input_object)
                                                         throws java.io.IOException,
                                                                java.lang.ClassNotFoundException
        Serializes an Object, deserializes it, and then returns it.
        Parameters:
        input_object -
        Returns:
        Object
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • assertTransientFieldsInitialized

        public static <T extends java.io.Serializable> void assertTransientFieldsInitialized​(T obj,
                                                                                             java.lang.String... excludedFields)
                                                                                      throws java.io.IOException,
                                                                                             java.lang.ClassNotFoundException,
                                                                                             java.lang.IllegalAccessException
        Check that transient fields are properly initialized after the object has been serialized and deserialized.
        Parameters:
        obj - A Serializable object to test.
        excludedFields - Names of fields that we do not care are not initialized after deserialization. Could be integers that are properly initialized to 0 or the like. Only include fields here if you are sure that initialization is not required!
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
        java.lang.IllegalAccessException