A B C D G H O P R S W 
All Classes All Packages

A

ApiRequest<T> - Interface in dev.mayuna.simpleapi
Represents an API request.
ApiRequestBuilder<T> - Class in dev.mayuna.simpleapi
A builder for ApiRequest.
ApiResponse<T extends WrappedApi> - Class in dev.mayuna.simpleapi
An abstract class to represent an API response.
ApiResponse() - Constructor for class dev.mayuna.simpleapi.ApiResponse
 
applyHeadersToHttpRequestBuilder(ApiRequest<T>, HttpRequest.Builder, RequestHeader[]) - Method in interface dev.mayuna.simpleapi.WrappedApi
Applies the RequestHeaders to the given HttpRequest.Builder.
If the ApiRequest.applyHeadersToHttpRequestBuilder(HttpRequest.Builder, RequestHeader[]) is overridden, this method may not be called, depending on the implementation.
applyHeadersToHttpRequestBuilder(HttpRequest.Builder, RequestHeader[]) - Method in interface dev.mayuna.simpleapi.ApiRequest
Applies the RequestHeaders to the given HttpRequest.Builder.

B

build() - Method in class dev.mayuna.simpleapi.ApiRequestBuilder
Builds the ApiRequest.
builder(WrappedApi, Class<T>) - Static method in interface dev.mayuna.simpleapi.ApiRequest
Creates a new ApiRequestBuilder for the given WrappedApi and Class.

C

computeEndpoint(ApiRequest<T>) - Method in interface dev.mayuna.simpleapi.WrappedApi
Computers the endpoint of this ApiRequest.
If the ApiRequest.getComputedEndpoint() is overridden, this method may not be called, depending on the implementation.
createHttpClientInstance() - Method in interface dev.mayuna.simpleapi.ApiRequest
Creates a new HttpClient instance.
createHttpClientInstance() - Method in interface dev.mayuna.simpleapi.WrappedApi
Creates a new HttpClient instance that will be used for sending requests.
If the ApiRequest.createHttpClientInstance() is overridden, this method may not be called, depending on the implementation.
createHttpRequestBuilderInstance() - Method in interface dev.mayuna.simpleapi.ApiRequest
Creates a new HttpRequest.Builder instance.
createHttpRequestBuilderInstance() - Method in interface dev.mayuna.simpleapi.WrappedApi
Creates a new HttpRequest.Builder instance that will be used for building requests.
If the ApiRequest.createHttpRequestBuilderInstance() is overridden, this method may not be called, depending on the implementation.
createInstanceOfResponseClass() - Method in interface dev.mayuna.simpleapi.ApiRequest
Creates a new instance of the response class.
createInstanceOfResponseClass(Class<T>) - Method in interface dev.mayuna.simpleapi.WrappedApi
Creates a new instance of the response class.
If the ApiRequest.createInstanceOfResponseClass() is overridden, this method may not be called, depending on the implementation.

D

DELETE - Static variable in class dev.mayuna.simpleapi.RequestMethod
 
DeserializableApiResponse<T extends WrappedApi> - Class in dev.mayuna.simpleapi
An API response that can be deserialized.
DeserializableApiResponse() - Constructor for class dev.mayuna.simpleapi.DeserializableApiResponse
 
deserialize(ApiRequest<?>, HttpResponse<?>) - Method in class dev.mayuna.simpleapi.DeserializableApiResponse
Deserialize the response body into an object of current type.
deserialize(ApiRequest<?>, HttpResponse<?>) - Method in class dev.mayuna.simpleapi.GsonApiResponse
 
dev.mayuna.simpleapi - package dev.mayuna.simpleapi
 

G

GET - Static variable in class dev.mayuna.simpleapi.RequestMethod
 
getBodyHandler() - Method in interface dev.mayuna.simpleapi.ApiRequest
Gets the HttpResponse.BodyHandler of this ApiRequest.
getBodyPublisher() - Method in interface dev.mayuna.simpleapi.ApiRequest
Gets the HttpRequest.BodyPublisher of this ApiRequest.
getComputedEndpoint() - Method in interface dev.mayuna.simpleapi.ApiRequest
Gets the computed endpoint of this ApiRequest.
getDefaultRequestHeaders() - Method in interface dev.mayuna.simpleapi.WrappedApi
Gets the default RequestHeaders for this API.
Useful if you want to set some headers for all requests.
getDefaultUrl() - Method in interface dev.mayuna.simpleapi.WrappedApi
Gets the default URL for this API.
getEndpoint() - Method in interface dev.mayuna.simpleapi.ApiRequest
Gets the endpoint of this ApiRequest.
getGson() - Method in class dev.mayuna.simpleapi.GsonApiResponse
Get a Gson instance.
getPathParameters() - Method in interface dev.mayuna.simpleapi.ApiRequest
Gets the PathParameters of this ApiRequest.
getRequestHeaders() - Method in interface dev.mayuna.simpleapi.ApiRequest
Gets the RequestHeaders of this ApiRequest.
getRequestMethod() - Method in interface dev.mayuna.simpleapi.ApiRequest
Gets the RequestMethod of this ApiRequest.
getRequestQueries() - Method in interface dev.mayuna.simpleapi.ApiRequest
Gets the RequestQuerys of this ApiRequest.
getResponseClass() - Method in interface dev.mayuna.simpleapi.ApiRequest
Gets the Class of the response.
getUrl() - Method in interface dev.mayuna.simpleapi.ApiRequest
Gets the URL of this ApiRequest.
getWrappedApi() - Method in interface dev.mayuna.simpleapi.ApiRequest
Gets the WrappedApi of this ApiRequest.
GsonApiResponse<T extends WrappedApi> - Class in dev.mayuna.simpleapi
Implements DeserializableApiResponse using Gson library.
GsonApiResponse() - Constructor for class dev.mayuna.simpleapi.GsonApiResponse
 

H

handleResponse(ApiRequest<T>, HttpResponse<?>) - Method in interface dev.mayuna.simpleapi.WrappedApi
Handles the given HttpResponse.
If the ApiRequest.handleResponse(HttpResponse) is overridden, this method may not be called, depending on the implementation.
handleResponse(HttpResponse<?>) - Method in interface dev.mayuna.simpleapi.ApiRequest
Handles the given HttpResponse.

O

of(String, String) - Static method in class dev.mayuna.simpleapi.RequestHeader
Create a new RequestHeader instance.
of(String, String) - Static method in class dev.mayuna.simpleapi.PathParameter
Creates PathParameter with parameter name and its replacement
of(String, String) - Static method in class dev.mayuna.simpleapi.RequestQuery
Creates RequestQuery with name and value
of(String) - Static method in class dev.mayuna.simpleapi.RequestMethod
Creates RequestMethod with request method name
ofContentType(String) - Static method in class dev.mayuna.simpleapi.RequestHeader
Create a new RequestHeader instance with the key Content-Type.
ofResponse(WrappedApi, Class<T>) - Static method in class dev.mayuna.simpleapi.ApiRequestBuilder
Creates a new ApiRequestBuilder for the given WrappedApi and Class.
onAfterApiRequest(ApiRequest<T>) - Method in interface dev.mayuna.simpleapi.WrappedApi
It is called after the request is sent but before the response is handled.
If the request send fails with exception, this method is not called.
onAfterHandledApiRequest(ApiRequest<T>, T) - Method in interface dev.mayuna.simpleapi.WrappedApi
It is called after the request's response is handled.
If the request send and/or request's response handler fails with exception, this method is not called.
onApiRequest(ApiRequest<T>) - Method in interface dev.mayuna.simpleapi.WrappedApi
Is called before the request is sent.
onException(ApiRequest<T>, Throwable) - Method in interface dev.mayuna.simpleapi.WrappedApi
It is called when any exception occurs when sending the request or handling the response.

Note: This method does not catch any exceptions.
All exceptions are re-thrown after this method is called, if the rethrowExceptions() returns true.

P

PathParameter - Class in dev.mayuna.simpleapi
Represents path parameter which will be replaced in your request
POST - Static variable in class dev.mayuna.simpleapi.RequestMethod
 
PUT - Static variable in class dev.mayuna.simpleapi.RequestMethod
 

R

RequestHeader - Class in dev.mayuna.simpleapi
 
RequestMethod - Class in dev.mayuna.simpleapi
 
RequestQuery - Class in dev.mayuna.simpleapi
 
rethrowExceptions() - Method in interface dev.mayuna.simpleapi.WrappedApi
Determines if exceptions should be re-thrown after onException(ApiRequest, Throwable) is called.
Also, if this method returns false, all responses that failed to be sent or handled will be null.
runAsync(Runnable) - Method in interface dev.mayuna.simpleapi.WrappedApi
This method is used for async requests.

S

send() - Method in interface dev.mayuna.simpleapi.ApiRequest
Sends the request synchronously.
send(ApiRequest<T>) - Method in interface dev.mayuna.simpleapi.WrappedApi
Sends the request synchronously.
If the ApiRequest.send() is overridden, this method may not be called, depending on the implementation.
sendAsync() - Method in interface dev.mayuna.simpleapi.ApiRequest
Sends the request asynchronously using runAsync(Runnable).

W

withBodyHandler(HttpResponse.BodyHandler<?>) - Method in class dev.mayuna.simpleapi.ApiRequestBuilder
Sets the HttpResponse.BodyHandler of the request.
withBodyPublisher(HttpRequest.BodyPublisher) - Method in class dev.mayuna.simpleapi.ApiRequestBuilder
Sets the HttpRequest.BodyPublisher of the request.
withEndpoint(String) - Method in class dev.mayuna.simpleapi.ApiRequestBuilder
Sets the endpoint of the request.
withPathParameter(PathParameter) - Method in class dev.mayuna.simpleapi.ApiRequestBuilder
Adds a PathParameter to the request.
withPathParameters(PathParameter, PathParameter...) - Method in class dev.mayuna.simpleapi.ApiRequestBuilder
Adds multiple PathParameters to the request.
withRequestHeader(RequestHeader) - Method in class dev.mayuna.simpleapi.ApiRequestBuilder
Adds a RequestHeader to the request.
withRequestHeaders(RequestHeader, RequestHeader...) - Method in class dev.mayuna.simpleapi.ApiRequestBuilder
Adds multiple RequestHeaders to the request.
withRequestMethod(RequestMethod) - Method in class dev.mayuna.simpleapi.ApiRequestBuilder
Sets the request method of the request.
Pro-tip: You can use pre-defined instances of RequestMethod like RequestMethod.GET.
withRequestMethod(String) - Method in class dev.mayuna.simpleapi.ApiRequestBuilder
 
withRequestQueries(RequestQuery, RequestQuery...) - Method in class dev.mayuna.simpleapi.ApiRequestBuilder
Adds multiple RequestQuerys to the request.
withRequestQuery(RequestQuery) - Method in class dev.mayuna.simpleapi.ApiRequestBuilder
Adds a RequestQuery to the request.
withUrl(String) - Method in class dev.mayuna.simpleapi.ApiRequestBuilder
Sets the url of the request.
WrappedApi - Interface in dev.mayuna.simpleapi
 
A B C D G H O P R S W 
All Classes All Packages