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.
Implements
DeserializableApiResponse using Gson library. Your class must have a constructor without any arguments.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(ApiRequest<?> apiRequest, HttpResponse<?> httpResponse) Deserialize the response body into an object of current type.com.google.gson.GsongetGson()Get a Gson instance.
-
Constructor Details
-
GsonApiResponse
public GsonApiResponse()
-
-
Method Details
-
getGson
public com.google.gson.Gson getGson()Get a Gson instance.- Returns:
- A Gson instance.
-
deserialize
Description copied from class:DeserializableApiResponseDeserialize the response body into an object of current type.- Specified by:
deserializein classDeserializableApiResponse<T extends WrappedApi>- Parameters:
apiRequest- The API request.httpResponse- The HTTP response.- Returns:
- The deserialized object.
-