A B D E G H M O P Q R S T
All Classes All Packages
All Classes All Packages
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
Actionobject - addPathParameter(PathParameter) - Method in class dev.mayuna.simpleapi.APIRequest.Builder
-
Adds
PathParameterto an existingPathParameterarray (or creates a new array if you have not set anyPathParameter) - addQuery(Query) - Method in class dev.mayuna.simpleapi.APIRequest.Builder
- 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
SimpleAPIobject (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 returnHttpResponse.BodyHandlers.ofString() - getBodyPublisher() - Method in interface dev.mayuna.simpleapi.APIRequest
-
Returns
HttpRequest.BodyPublisherwith request body.
Example: You are sending JSON in POST Request, so you pass your JSON intoHttpRequest.BodyPublishers.ofString(String)method - getContentType() - Method in interface dev.mayuna.simpleapi.APIRequest
-
Returns value which will be used in
Content-Typeheader. - 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 inAPIRequest.getQueries()method - getGson() - Method in interface dev.mayuna.simpleapi.deserializers.GsonDeserializer
-
Returns
Gsonobject 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}/statsAPI endpoint, so you must declarePathParameterwith parameteruser_idand your desired replacement - getQueries() - Method in interface dev.mayuna.simpleapi.APIRequest
- 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
Headerwith 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
-
FunctionwithHttpResponseargument and your response class return
ThisFunctionwill be called for deserializing. - onHttpError(Consumer<HttpError>) - Method in class dev.mayuna.simpleapi.Action
- onSuccess(BiConsumer<HttpResponse<?>, T>) - Method in class dev.mayuna.simpleapi.Action
-
HttpResponseand your response classBiConsumerwhich 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
PathParameterwith 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
Querywith 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
Consumerwhich hasHttpRequest.Builderargument - setMethod(String) - Method in class dev.mayuna.simpleapi.APIRequest.Builder
-
Sets HTTP Request method
- setPathParameters(PathParameter...) - Method in class dev.mayuna.simpleapi.APIRequest.Builder
-
Sets
PathParameters - 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
PathParameterin{parameter_name}format - toString() - Method in class dev.mayuna.simpleapi.Query
-
Returns
Queryinquery_name=query_valueformat
All Classes All Packages