Interface IObjectSerializer

All Known Implementing Classes:
ObjectSerializer

public interface IObjectSerializer
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    deserialize(String jsonString, Class<T> clazz)
    Deserializes a JSON string into an object of the specified class type.
    serialize(Object object)
    Serializes an object into a JSON string.
  • Method Details

    • deserialize

      <T> T deserialize(String jsonString, Class<T> clazz)
      Deserializes a JSON string into an object of the specified class type.
      Type Parameters:
      T - the type of the object to deserialize.
      Parameters:
      jsonString - the JSON string to deserialize.
      clazz - the Class of the object to deserialize.
      Returns:
      the deserialized object of type T.
      Throws:
      IllegalArgumentException - if the JSON string is null or empty.
    • serialize

      String serialize(Object object)
      Serializes an object into a JSON string.
      Parameters:
      object - the object to serialize.
      Returns:
      the serialized JSON string.
      Throws:
      IllegalArgumentException - if the object is null.