Interface JsonSerializer
-
- All Superinterfaces:
JsonSerializer
,ObjectSerializer
public interface JsonSerializer extends JsonSerializer
Generic interface covering basic JSON serialization and deserialization methods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
deserializeTree(JsonNode jsonNode, TypeReference<T> typeReference)
Reads a JSON tree into its object representation.<T> Mono<T>
deserializeTreeAsync(JsonNode jsonNode, TypeReference<T> typeReference)
Reads a JSON tree into its object representation.void
serializeTree(OutputStream stream, JsonNode jsonNode)
Writes a JSON tree into a stream.Mono<Void>
serializeTreeAsync(OutputStream stream, JsonNode jsonNode)
Writes a JSON tree into a stream.JsonNode
toTree(InputStream stream)
Reads a JSON stream into its JSON tree representation.JsonNode
toTree(Object value)
Writes an object into its JSON tree representation.Mono<JsonNode>
toTreeAsync(InputStream stream)
Reads a JSON stream into its JSON tree representation.Mono<JsonNode>
toTreeAsync(Object value)
Writes an object into its JSON tree representation.-
Methods inherited from interface com.azure.core.util.serializer.JsonSerializer
deserialize, deserializeAsync, deserializeFromBytes, deserializeFromBytesAsync, serialize, serializeAsync, serializeToBytes, serializeToBytesAsync
-
-
-
-
Method Detail
-
deserializeTree
<T> T deserializeTree(JsonNode jsonNode, TypeReference<T> typeReference)
Reads a JSON tree into its object representation.- Type Parameters:
T
- Type of the object.- Parameters:
jsonNode
- The JSON tree.typeReference
-TypeReference
representing the object.- Returns:
- The object represented by the deserialized JSON tree.
-
deserializeTreeAsync
<T> Mono<T> deserializeTreeAsync(JsonNode jsonNode, TypeReference<T> typeReference)
Reads a JSON tree into its object representation.- Type Parameters:
T
- Type of the object.- Parameters:
jsonNode
- The JSON tree.typeReference
-TypeReference
representing the object.- Returns:
- The object represented by the deserialized JSON tree.
-
serializeTree
void serializeTree(OutputStream stream, JsonNode jsonNode)
Writes a JSON tree into a stream.- Parameters:
stream
-OutputStream
where the JSON tree will be written.jsonNode
- The JSON tree.
-
serializeTreeAsync
Mono<Void> serializeTreeAsync(OutputStream stream, JsonNode jsonNode)
Writes a JSON tree into a stream.- Parameters:
stream
-OutputStream
where the JSON tree will be written.jsonNode
- The JSON tree.- Returns:
- Reactive stream that will indicate operation completion.
-
toTree
JsonNode toTree(InputStream stream)
Reads a JSON stream into its JSON tree representation.- Parameters:
stream
- JSON stream.- Returns:
- The JSON tree representing the deserialized JSON byte array.
-
toTreeAsync
Mono<JsonNode> toTreeAsync(InputStream stream)
Reads a JSON stream into its JSON tree representation.- Parameters:
stream
- JSON stream.- Returns:
- The JSON tree representing the deserialized JSON byte array.
-
toTree
JsonNode toTree(Object value)
Writes an object into its JSON tree representation.- Parameters:
value
- The object.- Returns:
- The JSON tree representing the object.
-
-