JsonSerializer Interface
Implements
public interface JsonSerializer
extends ObjectSerializer
Generic interface covering basic JSON serialization and deserialization methods.
Method Summary
Modifier and Type | Method and Description |
---|---|
abstract T |
deserialize(InputStream stream, TypeReference<T> typeReference)
Reads a JSON stream into its object representation. |
abstract Mono<T> |
deserializeAsync(InputStream stream, TypeReference<T> typeReference)
Reads a JSON stream into its object representation. |
default T |
deserializeFromBytes(byte[] data, TypeReference<T> typeReference)
Reads a JSON byte array into its object representation. |
default Mono<T> |
deserializeFromBytesAsync(byte[] data, TypeReference<T> typeReference)
Reads a JSON byte array into its object representation. |
abstract void |
serialize(OutputStream stream, Object value)
Writes an object's JSON representation into a stream. |
abstract Mono<Void> |
serializeAsync(OutputStream stream, Object value)
Writes an object's JSON representation into a stream. |
default byte[] |
serializeToBytes(Object value)
Converts the object into a JSON byte array. |
default Mono<byte[]> |
serializeToBytesAsync(Object value)
Converts the object into a JSON byte array. |
Method Details
deserialize
public abstract T
Reads a JSON stream into its object representation.
Parameters:
Returns:
deserializeAsync
public abstract Mono
Reads a JSON stream into its object representation.
Parameters:
Returns:
deserializeFromBytes
public default T
Reads a JSON byte array into its object representation.
Parameters:
Returns:
deserializeFromBytesAsync
public default Mono
Reads a JSON byte array into its object representation.
Parameters:
Returns:
serialize
public abstract void serialize(OutputStream stream, Object value)
Writes an object's JSON representation into a stream.
Parameters:
serializeAsync
public abstract Mono
Writes an object's JSON representation into a stream.
Parameters:
Returns:
serializeToBytes
public default byte[] serializeToBytes(Object value)
Converts the object into a JSON byte array.
Parameters:
Returns:
serializeToBytesAsync
public default Mono
Converts the object into a JSON byte array.
Parameters:
Returns: