public class JsonResultWrapper extends Object implements Function<Object[],Object>, Serializable
| Modifier and Type | Class and Description |
|---|---|
static interface |
JsonResultWrapper.ExceptionFunction
A function that may throw an exception.
|
static class |
JsonResultWrapper.Result
Represents the result w/o exception.
|
| Modifier and Type | Field and Description |
|---|---|
private JsonResultWrapper.ExceptionFunction |
func |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
JsonResultWrapper(JsonResultWrapper.ExceptionFunction func)
Creates a wrapper object.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
apply(Object[] param) |
static String |
fromJson(Object json)
Turns something in JSON into a result via an instance of
Result. |
static JsonResultWrapper.Result |
resultFromJson(Object json)
Turns something in JSON into a
Result. |
static String |
toJson(JsonResultWrapper.Result res)
Turns a
JsonResultWrapper.Result into JSON. |
private static final long serialVersionUID
private JsonResultWrapper.ExceptionFunction func
public JsonResultWrapper(JsonResultWrapper.ExceptionFunction func)
func - a function that may throw an exception.public static String toJson(JsonResultWrapper.Result res)
JsonResultWrapper.Result into JSON.res - the result instance (may be null)public static JsonResultWrapper.Result resultFromJson(Object json)
Result.json - the JSON value, usually a Stringpublic static String fromJson(Object json) throws ExecutionException
Result.json - the JSON value, usually a Stringjson is nullExecutionException - if the parsed JsonResultWrapper.Result represents an exceptionCopyright © 2021. All rights reserved.