Interface SerializationStrategy

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> T deserialize​(java.lang.Class<T> clazz, java.lang.String value)
      Reconstructs the object from its string representation, which was created by serialize(Object).
      java.lang.String serialize​(java.lang.Object obj)
      Converts the object to its string representation which can be supplied to deserialize(Class, String) to reconstruct the object.
      boolean supports​(java.lang.Class<?> clazz)
      Does this strategy support the specified type? Generic implementations may simply always return true.
    • Method Detail

      • supports

        boolean supports​(java.lang.Class<?> clazz)
        Does this strategy support the specified type? Generic implementations may simply always return true.
        Returns:
        whether this strategy supports serializing and deserializing the type.
      • serialize

        java.lang.String serialize​(java.lang.Object obj)
                            throws java.lang.Exception
        Converts the object to its string representation which can be supplied to deserialize(Class, String) to reconstruct the object.
        Parameters:
        obj - (not null)
        Returns:
        string representation of the object
        Throws:
        java.lang.Exception - any failure to serialize
      • deserialize

        <T> T deserialize​(java.lang.Class<T> clazz,
                          java.lang.String value)
                   throws java.lang.Exception
        Reconstructs the object from its string representation, which was created by serialize(Object).
        Parameters:
        clazz - (not null) type of object
        value - (not null) string representation
        Returns:
        the reconstructed object
        Throws:
        java.lang.Exception - any failure to deserialize