public interface JsonUtil
| Modifier and Type | Method and Description |
|---|---|
String |
pretty(Object object)
Returns prettified json of the object
|
<T> List<T> |
readList(InputStream stream,
Class<T> clazz)
Parses the json to List of desired type
|
<T> List<T> |
readList(String json,
Class<T> clazz)
Parses the json to List of desired type
|
<K,V> Map<K,V> |
readMap(String json,
Class<K> keyClass,
Class<V> valueClass)
Parses the json to Map of desired type
|
<T> T |
readObject(InputStream jsonStream,
Class<T> clazz)
Parses the json to desired type
|
<T> T |
readObject(String json,
Class<T> clazz)
Reads json as Object
|
String |
toJsonString(Object object)
Method convert to json string for the input object
|
<T> T readObject(InputStream jsonStream, Class<T> clazz) throws CoreRtException
T - GenericsjsonStream - The input streamclazz - The Object typeCoreRtException - in case of any Exception<T> List<T> readList(InputStream stream, Class<T> clazz) throws CoreRtException
T - Genericsstream - The JSON streamclazz - The Object typeCoreRtException - in case of any Exception<T> List<T> readList(String json, Class<T> clazz) throws CoreRtException
T - Genericsjson - The JSONclazz - The Object typeCoreRtException - in case of any Exception<K,V> Map<K,V> readMap(String json, Class<K> keyClass, Class<V> valueClass) throws CoreRtException
K - GenericsV - Genericsjson - The JSONkeyClass - The Key TypevalueClass - The Value TypeCoreRtException - in case of any ExceptionString toJsonString(Object object) throws CoreRtException
object - Object - The input objectString - The output json stringCoreRtException - in case of any Exception<T> T readObject(String json, Class<T> clazz) throws CoreRtException
T - Genericsjson - The jsonclazz - The class of ObjectCoreRtException - in case of any ExceptionString pretty(Object object) throws CoreRtException
object - The objectCoreRtException - in case of any ExceptionCopyright © 2018. All rights reserved.