Interface JsonSerializer

All Known Implementing Classes:
DefaultJsonSerializer, JacksonJsonSerializer, JsonValueSerializerWrapper

public interface JsonSerializer
The JsonSerializer handles the serialization and deserialization of raw json data into java objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T> T
    deserialize(TypeRef<T> target, byte[] input)
    Deserializes raw input into the target type.
    <T> T
    deserialize(Class<T> target, byte[] input)
    Deserializes raw input into the target class.
    byte[]
    Serializes the given input into its encoded byte array form.
  • Method Details

    • serialize

      byte[] serialize(Object input)
      Serializes the given input into its encoded byte array form.
      Parameters:
      input - the object as input.
      Returns:
      the serialized output.
    • deserialize

      <T> T deserialize(Class<T> target, byte[] input)
      Deserializes raw input into the target class.
      Type Parameters:
      T - the generic type to deserialize into.
      Parameters:
      target - the target class.
      input - the raw input.
      Returns:
      the deserialized output.
    • deserialize

      default <T> T deserialize(TypeRef<T> target, byte[] input)
      Deserializes raw input into the target type.
      Type Parameters:
      T - the type to deserialize into.
      Parameters:
      target - the target type.
      input - the raw input.
      Returns:
      the deserialized output.