Package com.couchbase.client.java.codec
Interface JsonSerializer
-
- All Known Implementing Classes:
DefaultJsonSerializer,JacksonJsonSerializer,JsonValueSerializerWrapper
public interface JsonSerializerTheJsonSerializerhandles the serialization and deserialization of raw json data into java objects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> Tdeserialize(TypeRef<T> target, byte[] input)Deserializes raw input into the target type.<T> Tdeserialize(Class<T> target, byte[] input)Deserializes raw input into the target class.byte[]serialize(Object input)Serializes the given input into its encoded byte array form.
-
-
-
Method Detail
-
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.
-
-