Class JsonSerializationStrategy

    • Constructor Detail

      • JsonSerializationStrategy

        public JsonSerializationStrategy()
    • Method Detail

      • supports

        public boolean supports​(java.lang.Class<?> clazz)
        Always returns true.
        Specified by:
        supports in interface SerializationStrategy
        Returns:
        whether this strategy supports serializing and deserializing the type.
      • serialize

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

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