Class SerializationUtil


  • public class SerializationUtil
    extends org.apache.commons.lang3.SerializationUtils
    Author:
    Yohann Chastagnier
    See Also:
    SerializationUtils
    • Constructor Detail

      • SerializationUtil

        public SerializationUtil()
    • Method Detail

      • serializeAsString

        public static String serializeAsString​(Serializable obj)

        Serializes an Object to a string forstorage/serialization.

        Parameters:
        obj - the object to serialize to bytes
        Returns:
        a string with the converted Serializable
        Throws:
        org.apache.commons.lang3.SerializationException - (runtime) if the serialization fails
      • deserializeFromString

        public static <T extends Serializable> T deserializeFromString​(String objectStringData)

        Deserializes a single Object from a string.

        Type Parameters:
        T - the type of the returned serializable object
        Parameters:
        objectStringData - the serialized object, must not be null
        Returns:
        the deserialized object
        Throws:
        IllegalArgumentException - if objectData is null
        org.apache.commons.lang3.SerializationException - (runtime) if the serialization fails