public static interface Json.JsonCodec
Modifier and Type | Method and Description |
---|---|
<T> T |
fromJson(String json,
Class<T> type)
Convert the given JSON string to an object of the given type.
|
InputStream |
toInputStream(Object o,
Class<?> type)
Convert the given object to an
InputStream . |
String |
toJson(Object o)
Convert the given object to JSON.
|
String toJson(Object o)
o
- the object to convert.<T> T fromJson(String json, Class<T> type)
T
- the type of the object.json
- the JSON string.type
- the type of the object.InputStream toInputStream(Object o, Class<?> type) throws IOException
InputStream
.o
- the object to convert.type
- the type of the object.InputStream
.IOException
- if an I/O error occurs.Copyright © 2024. All rights reserved.