Package com.algolia.config
Interface Requester
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
HttpRequester
Represents a mechanism for executing HTTP requests and deserializing responses. It provides
methods for making requests and returning the desired object representation. Implementations of
this interface should ensure proper resource management.
-
Method Summary
Modifier and TypeMethodDescription<T> T
execute
(HttpRequest httpRequest, RequestOptions requestOptions, com.fasterxml.jackson.core.type.TypeReference<?> returnType) Executes an HTTP request and deserializes the response into a specified type reference.<T> T
execute
(HttpRequest httpRequest, RequestOptions requestOptions, Class<?> returnType, Class<?> innerType) Executes an HTTP request and deserializes the response into a specified Java type.
-
Method Details
-
execute
<T> T execute(HttpRequest httpRequest, RequestOptions requestOptions, Class<?> returnType, Class<?> innerType) Executes an HTTP request and deserializes the response into a specified Java type.- Type Parameters:
T
- The type of the returned object.- Parameters:
httpRequest
- The HTTP request to be executed.requestOptions
- Optional request options.returnType
- The class of the response.innerType
- The inner class type if the response is a container type.- Returns:
- The deserialized response.
-
execute
<T> T execute(HttpRequest httpRequest, RequestOptions requestOptions, com.fasterxml.jackson.core.type.TypeReference<?> returnType) Executes an HTTP request and deserializes the response into a specified type reference.- Type Parameters:
T
- The type of the returned object.- Parameters:
httpRequest
- The HTTP request to be executed.requestOptions
- Optional request options.returnType
- The type reference of the response.- Returns:
- The deserialized response.
-