Interface ISerializer

All Known Implementing Classes:
DefaultSerializer

public interface ISerializer
Serializes and deserializes items from strings into their types
  • Method Details

    • deserializeObject

      @Nullable default <T> T deserializeObject(@Nonnull String inputString, @Nonnull Class<T> clazz)
      Deserialize an object from the input string
      Type Parameters:
      T - the type of the item to be deserialized
      Parameters:
      inputString - the string that stores the representation of the item
      clazz - the Class of the item to be deserialized
      Returns:
      the deserialized item from the input string
    • deserializeObject

      @Nullable <T> T deserializeObject(@Nonnull String inputString, @Nonnull Class<T> clazz, @Nullable Map<String,​List<String>> responseHeaders)
      Deserialize an object from the input string
      Type Parameters:
      T - the type of the item to be deserialized
      Parameters:
      inputString - the string that stores the representation of the item
      clazz - the Class of the item to be deserialized
      responseHeaders - the HTTP response headers
      Returns:
      the deserialized item from the input string
    • deserializeObject

      @Nullable default <T> T deserializeObject(@Nonnull InputStream inputStream, @Nonnull Class<T> clazz)
      Deserialize an object from the input stream
      Type Parameters:
      T - the type of the item to be deserialized
      Parameters:
      inputStream - the stream that stores the representation of the item
      clazz - the Class of the item to be deserialized
      Returns:
      the deserialized item from the input string
    • deserializeObject

      @Nullable <T> T deserializeObject(@Nonnull InputStream inputStream, @Nonnull Class<T> clazz, @Nullable Map<String,​List<String>> responseHeaders)
      Deserialize an object from the input stream
      Type Parameters:
      T - the type of the item to be deserialized
      Parameters:
      inputStream - the stream that stores the representation of the item
      clazz - the Class of the item to be deserialized
      responseHeaders - the HTTP response headers
      Returns:
      the deserialized item from the input string
    • deserializeObject

      @Nullable default <T> T deserializeObject(@Nonnull com.google.gson.JsonElement jsonElement, @Nonnull Class<T> clazz)
      Deserialize an object from the input JsonElement
      Type Parameters:
      T - the type of the item to be deserialized
      Parameters:
      jsonElement - the JsonElement that stores the representation of the item
      clazz - the Class of the item to be deserialized
      Returns:
      the deserialized item from the input string
    • deserializeObject

      @Nullable <T> T deserializeObject(@Nonnull com.google.gson.JsonElement jsonElement, @Nonnull Class<T> clazz, @Nullable Map<String,​List<String>> responseHeaders)
      Deserialize an object from the input JsonElement
      Type Parameters:
      T - the type of the item to be deserialized
      Parameters:
      jsonElement - the JsonElement that stores the representation of the item
      clazz - the Class of the item to be deserialized
      responseHeaders - the HTTP response headers
      Returns:
      the deserialized item from the input string
    • serializeObject

      @Nullable <T> String serializeObject(@Nonnull T serializableObject)
      Serializes an object into a string
      Type Parameters:
      T - the type of the item to be serialized
      Parameters:
      serializableObject - the object to convert into a string
      Returns:
      the string representation of that item