public class ResponseDecomposer extends Object
Constructor and Description |
---|
ResponseDecomposer(JsonRpcResponse response)
Creates decomposer for a response.
|
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
decomposeError()
Decomposes response error as
Map . |
<T> T |
decomposeResponse(Class<T> clazz)
Decomposes response to provided type.
|
<T> T[] |
decomposeTypedArray(Object[] array,
Class<T> clazz,
String subtypeKey)
Decomposes response to provided typed array.
|
boolean |
isError() |
public ResponseDecomposer(JsonRpcResponse response)
response
- - Used for decomposition.public boolean isError()
true
when response contains JsonRpcError
object
otherwise false
public <T> T decomposeResponse(Class<T> clazz)
T
- -Type of the object to which response will be decomposed.clazz
- - Class to which response will be decomposed.public <T> T[] decomposeTypedArray(Object[] array, Class<T> clazz, String subtypeKey)
T
- -Type of the object to which response will be decomposed.array
- - An array of objects to be decomposed.clazz
- - Class to which response will be decomposed.subtypeKey
- - The key which is used to store objects in decomposed map.Copyright © 2016. All rights reserved.