Package me.geso.mech2
Class Mech2JSONResult<T>
java.lang.Object
me.geso.mech2.Mech2JSONResult<T>
- Type Parameters:
T-
- Direct Known Subclasses:
Mech2JSONResult.Mech2JSONResultClass,Mech2JSONResult.Mech2JSONResultTypeReference
This class contains
Mech2Result and JSON type information.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptionGet Mech2Result instance.booleanstatic <T> Mech2JSONResult<T>of(Mech2Result result, com.fasterxml.jackson.core.type.TypeReference<T> klass) Create new instance.static <T> Mech2JSONResult<T>of(Mech2Result result, Class<T> klass) Create new instance.orDie()Throw exception if the response doesn't contain 2XX.abstract TParse JSON as object.
-
Method Details
-
of
public static <T> Mech2JSONResult<T> of(Mech2Result result, com.fasterxml.jackson.core.type.TypeReference<T> klass) Create new instance. But you shouldn't call this directly.- Parameters:
result- result objectklass- Type reference.- Returns:
- new instance
-
of
Create new instance. But you shouldn't call this directly.- Parameters:
result- result objectklass- destination type- Returns:
- created object
-
getResult
Get Mech2Result instance.- Returns:
- result object itself
-
orDie
Throw exception if the response doesn't contain 2XX.- Returns:
- object itself.
- Throws:
Mech2FailException- if the status code isn't 2XX.
-
isSuccess
public boolean isSuccess() -
parseJSON
Parse JSON as object.- Returns:
- parsed object
- Throws:
IOException
-