Package dev.mayuna.simpleapi
Class GsonApiResponse<T extends WrappedApi>
- java.lang.Object
-
- dev.mayuna.simpleapi.ApiResponse<T>
-
- dev.mayuna.simpleapi.DeserializableApiResponse<T>
-
- dev.mayuna.simpleapi.GsonApiResponse<T>
-
- Type Parameters:
T- The type of the API.
public abstract class GsonApiResponse<T extends WrappedApi> extends DeserializableApiResponse<T>
ImplementsDeserializableApiResponseusingGsonlibrary. Your class must have a constructor without any arguments.
-
-
Constructor Summary
Constructors Constructor Description GsonApiResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectdeserialize(java.lang.Object responseBody)Deserialize the response body into an object of current type.com.google.gson.GsongetGson()Get a Gson instance.
-
-
-
Method Detail
-
getGson
public com.google.gson.Gson getGson()
Get a Gson instance.- Returns:
- A Gson instance.
-
deserialize
public java.lang.Object deserialize(java.lang.Object responseBody)
Description copied from class:DeserializableApiResponseDeserialize the response body into an object of current type.- Specified by:
deserializein classDeserializableApiResponse<T extends WrappedApi>- Parameters:
responseBody- The response body to deserialize.- Returns:
- The deserialized object.
-
-