Package org.silverpeas.core.util
Class SerializationUtil
- java.lang.Object
-
- org.apache.commons.lang3.SerializationUtils
-
- org.silverpeas.core.util.SerializationUtil
-
public class SerializationUtil extends org.apache.commons.lang3.SerializationUtils
- Author:
- Yohann Chastagnier
- See Also:
SerializationUtils
-
-
Constructor Summary
Constructors Constructor Description SerializationUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends Serializable>
TdeserializeFromString(String objectStringData)
Deserializes a singleObject
from a string.static String
serializeAsString(Serializable obj)
Serializes anObject
to a string forstorage/serialization.
-
-
-
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
- ifobjectData
isnull
org.apache.commons.lang3.SerializationException
- (runtime) if the serialization fails
-
-