A B D E G H M O P Q R S T 
All Classes All Packages

A

Action<T> - Class in dev.mayuna.simpleapi
 
Action(SimpleAPI, Class<T>, APIRequest) - Constructor for class dev.mayuna.simpleapi.Action
Creates Action object
addPathParameter(PathParameter) - Method in class dev.mayuna.simpleapi.APIRequest.Builder
Adds PathParameter to an existing PathParameter array (or creates a new array if you have not set any PathParameter)
addQuery(Query) - Method in class dev.mayuna.simpleapi.APIRequest.Builder
Adds Query to an existing Query array (or creates a new array if you have not set any Query)
api - Variable in class dev.mayuna.simpleapi.APIResponse
 
APIRequest - Interface in dev.mayuna.simpleapi
 
APIRequest.Builder - Class in dev.mayuna.simpleapi
 
APIResponse<T extends SimpleAPI> - Class in dev.mayuna.simpleapi
Abstract class with which you can extend your response classes - They will be able to get http response code and your SimpleAPI object (useful for "live" API objects)
APIResponse() - Constructor for class dev.mayuna.simpleapi.APIResponse
 

B

build() - Method in class dev.mayuna.simpleapi.APIRequest.Builder
Builds you APIRequest
Builder() - Constructor for class dev.mayuna.simpleapi.APIRequest.Builder
 

D

dev.mayuna.simpleapi - package dev.mayuna.simpleapi
 
dev.mayuna.simpleapi.deserializers - package dev.mayuna.simpleapi.deserializers
 
dev.mayuna.simpleapi.exceptions - package dev.mayuna.simpleapi.exceptions
 

E

execute() - Method in class dev.mayuna.simpleapi.Action
Requests the API with specified APIRequest

G

getBodyHandler() - Method in interface dev.mayuna.simpleapi.APIRequest
This method must return expected API response body.
Example: You know, that the API will respond with Raw JSON, so you return HttpResponse.BodyHandlers.ofString()
getBodyPublisher() - Method in interface dev.mayuna.simpleapi.APIRequest
Returns HttpRequest.BodyPublisher with request body.
Example: You are sending JSON in POST Request, so you pass your JSON into HttpRequest.BodyPublishers.ofString(String) method
getContentType() - Method in interface dev.mayuna.simpleapi.APIRequest
Returns value which will be used in Content-Type header.
getDefaultHeads() - Method in class dev.mayuna.simpleapi.SimpleAPI
Default headers which will be added in every request.
getEndpoint() - Method in interface dev.mayuna.simpleapi.APIRequest
Returns API endpoint.
getFinalEndpoint() - Method in interface dev.mayuna.simpleapi.APIRequest
You should not override this method.
This method is used for inserting specified queries in APIRequest.getQueries() method
getGson() - Method in interface dev.mayuna.simpleapi.deserializers.GsonDeserializer
Returns Gson object which will be used for deserialization
getMethod() - Method in interface dev.mayuna.simpleapi.APIRequest
HTTP Method which will be used for requesting
Example: GET

This method is required.
getPathParameters() - Method in interface dev.mayuna.simpleapi.APIRequest
Returns array of PathParameters which will be used for replacing path parameters in APIs endpoint.
Example: You have /users/{user_id}/stats API endpoint, so you must declare PathParameter with parameter user_id and your desired replacement
getQueries() - Method in interface dev.mayuna.simpleapi.APIRequest
Returns array of Query(ies) which will be added after APIs endpoint.
Example:
getURL() - Method in class dev.mayuna.simpleapi.SimpleAPI
Base API URL
Example: https://example.come/v1
GsonDeserializer - Interface in dev.mayuna.simpleapi.deserializers
You can implement this interface into response object for automatic Gson deserialization via Gson.fromJson(String, Class)

H

Header - Class in dev.mayuna.simpleapi
 
Header(String, String) - Constructor for class dev.mayuna.simpleapi.Header
Creates Header with name and value
HttpError - Class in dev.mayuna.simpleapi
 
HttpError(int, Exception) - Constructor for class dev.mayuna.simpleapi.HttpError
HTTP error with its response code and Exception
HttpException - Exception in dev.mayuna.simpleapi.exceptions
This exception is thrown when some HTTP client related exception is thrown
HttpException(HttpError) - Constructor for exception dev.mayuna.simpleapi.exceptions.HttpException
 

M

MissingPathParametersException - Exception in dev.mayuna.simpleapi.exceptions
This exception is thrown if you've forgotten to replace some path parameters in endpoint path
MissingPathParametersException(String, APIRequest) - Constructor for exception dev.mayuna.simpleapi.exceptions.MissingPathParametersException
 

O

onDeserialization(Function<HttpResponse<?>, T>) - Method in class dev.mayuna.simpleapi.Action
Function with HttpResponse argument and your response class return
This Function will be called for deserializing.
onHttpError(Consumer<HttpError>) - Method in class dev.mayuna.simpleapi.Action
HttpError Consumer which will be called if there would be any HttpException
onSuccess(BiConsumer<HttpResponse<?>, T>) - Method in class dev.mayuna.simpleapi.Action
HttpResponse and your response class BiConsumer which will be called if the request was successful

P

PathParameter - Class in dev.mayuna.simpleapi
 
PathParameter(String, String) - Constructor for class dev.mayuna.simpleapi.PathParameter
Creates PathParameter with parameter name and its replacement
processHttpRequestBuilder(HttpRequest.Builder) - Method in interface dev.mayuna.simpleapi.APIRequest
This method is called when requesting.

Q

Query - Class in dev.mayuna.simpleapi
 
Query(String, String) - Constructor for class dev.mayuna.simpleapi.Query
Creates Query with name and value

R

responseCode - Variable in class dev.mayuna.simpleapi.APIResponse
 

S

setBodyHandler(HttpResponse.BodyHandler<?>) - Method in class dev.mayuna.simpleapi.APIRequest.Builder
Sets HttpResponse.BodyHandler
setBodyPublisher(HttpRequest.BodyPublisher) - Method in class dev.mayuna.simpleapi.APIRequest.Builder
Sets HttpRequest.BodyPublisher
setContentType(String) - Method in class dev.mayuna.simpleapi.APIRequest.Builder
Sets Content-Type header value
setEndpoint(String) - Method in class dev.mayuna.simpleapi.APIRequest.Builder
Sets APIs endpoint
setHttpRequestBuilder(Consumer<HttpRequest.Builder>) - Method in class dev.mayuna.simpleapi.APIRequest.Builder
Sets Consumer which has HttpRequest.Builder argument
setMethod(String) - Method in class dev.mayuna.simpleapi.APIRequest.Builder
Sets HTTP Request method
setPathParameters(PathParameter...) - Method in class dev.mayuna.simpleapi.APIRequest.Builder
setQueries(Query...) - Method in class dev.mayuna.simpleapi.APIRequest.Builder
Sets Queryies
SimpleAPI - Class in dev.mayuna.simpleapi
 
SimpleAPI() - Constructor for class dev.mayuna.simpleapi.SimpleAPI
 

T

toString() - Method in class dev.mayuna.simpleapi.PathParameter
Returns PathParameter in {parameter_name} format
toString() - Method in class dev.mayuna.simpleapi.Query
Returns Query in query_name=query_value format
A B D E G H M O P Q R S T 
All Classes All Packages