T - public abstract class Mech2JSONResult<T> extends Object
Mech2Result and JSON type information.| Modifier and Type | Class and Description |
|---|---|
static class |
Mech2JSONResult.Mech2JSONResultClass<T> |
static class |
Mech2JSONResult.Mech2JSONResultTypeReference<T> |
| Modifier and Type | Method and Description |
|---|---|
Mech2Result |
getResult()
Get Mech2Result instance.
|
boolean |
isSuccess() |
static <T> Mech2JSONResult<T> |
of(Mech2Result result,
Class<T> klass)
Create new instance.
|
static <T> Mech2JSONResult<T> |
of(Mech2Result result,
com.fasterxml.jackson.core.type.TypeReference<T> klass)
Create new instance.
|
Mech2JSONResult<T> |
orDie()
Throw exception if the response doens't contains 2XX.
|
abstract T |
parseJSON()
Parse JSON as object.
|
public static <T> Mech2JSONResult<T> of(Mech2Result result, com.fasterxml.jackson.core.type.TypeReference<T> klass)
result - klass - public static <T> Mech2JSONResult<T> of(Mech2Result result, Class<T> klass)
result - klass - public Mech2Result getResult()
public Mech2JSONResult<T> orDie() throws Mech2FailException
Mech2FailExceptionpublic boolean isSuccess()
public abstract T parseJSON() throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
com.fasterxml.jackson.core.JsonParseExceptioncom.fasterxml.jackson.databind.JsonMappingExceptionIOExceptionCopyright © 2015. All rights reserved.