T - public abstract class Mech2JSONResult<T> extends Object
Mech2Result and JSON type information.| 修飾子とタイプ | クラスと説明 |
|---|---|
static class |
Mech2JSONResult.Mech2JSONResultClass<T> |
static class |
Mech2JSONResult.Mech2JSONResultTypeReference<T> |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
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 doesn't contain 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 - result objectklass - Type reference.public static <T> Mech2JSONResult<T> of(Mech2Result result, Class<T> klass)
result - result objectklass - destination typepublic Mech2Result getResult()
public Mech2JSONResult<T> orDie() throws Mech2FailException
Mech2FailException - if the status code isn't 2XX.public boolean isSuccess()
public abstract T parseJSON() throws IOException
IOExceptionCopyright © 2015. All rights reserved.