public interface JsonCodec
Modifier and Type | Method and Description |
---|---|
<T> T |
fromBuffer(Buffer json,
Class<T> clazz)
Like
fromString(String, Class) but with a json Buffer |
<T> T |
fromString(String json,
Class<T> clazz)
Decode the provide
json string to an object extending clazz . |
<T> T |
fromValue(Object json,
Class<T> toValueType)
Like
fromString(String, Class) but with a json Object |
default Buffer |
toBuffer(Object object)
Like
toString(Object) but with a json Buffer |
Buffer |
toBuffer(Object object,
boolean pretty)
Like
toString(Object, boolean) but with a json Buffer |
default String |
toString(Object object)
Encode the specified
object to a string. |
String |
toString(Object object,
boolean pretty)
Encode the specified
object to a string. |
<T> T fromString(String json, Class<T> clazz) throws DecodeException
json
string to an object extending clazz
.json
- the json stringclazz
- the required object's classDecodeException
- anything preventing the decoding<T> T fromBuffer(Buffer json, Class<T> clazz) throws DecodeException
fromString(String, Class)
but with a json Buffer
DecodeException
<T> T fromValue(Object json, Class<T> toValueType)
fromString(String, Class)
but with a json Object
default String toString(Object object) throws EncodeException
object
to a string.EncodeException
String toString(Object object, boolean pretty) throws EncodeException
object
to a string.object
- the object to encodepretty
- true
to format the string prettilyDecodeException
- anything preventing the encodingEncodeException
Buffer toBuffer(Object object, boolean pretty) throws EncodeException
toString(Object, boolean)
but with a json Buffer
EncodeException
default Buffer toBuffer(Object object) throws EncodeException
toString(Object)
but with a json Buffer
EncodeException
Copyright © 2024 Eclipse. All rights reserved.