Package dev.mayuna.simpleapi
Class DeserializableApiResponse<T extends WrappedApi>
- java.lang.Object
-
- dev.mayuna.simpleapi.ApiResponse<T>
-
- dev.mayuna.simpleapi.DeserializableApiResponse<T>
-
- Type Parameters:
T- The type of the wrapped API.
- Direct Known Subclasses:
GsonApiResponse
public abstract class DeserializableApiResponse<T extends WrappedApi> extends ApiResponse<T>
An API response that can be deserialized. Your class must have a constructor without any arguments.
-
-
Constructor Summary
Constructors Constructor Description DeserializableApiResponse()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract java.lang.Objectdeserialize(ApiRequest<?> apiRequest, java.net.http.HttpResponse<?> httpResponse)Deserialize the response body into an object of current type.
-
-
-
Method Detail
-
deserialize
public abstract java.lang.Object deserialize(ApiRequest<?> apiRequest, java.net.http.HttpResponse<?> httpResponse)
Deserialize the response body into an object of current type.- Parameters:
apiRequest- The API request.httpResponse- The HTTP response.- Returns:
- The deserialized object.
-
-