Package co.elastic.clients.base
Interface Endpoint<RequestT,ResponseT,ErrorT>
- Type Parameters:
RequestT
- the endpoint's requestResponseT
- the endpoint's response. UseVoid
when there's no response body.ErrorT
- the endpoint's error type. UseVoid
when error responses have no body.
- All Known Implementing Classes:
BooleanEndpoint
,SimpleEndpoint
public interface Endpoint<RequestT,ResponseT,ErrorT>
And endpoint links request and responses to protocol encoding. It also defines the error response
when the server cannot perform the request.
-
Method Summary
Modifier and Type Method Description JsonpDeserializer<ErrorT>
errorParser(int statusCode)
The entity parser for the error response body.boolean
hasRequestBody()
default java.util.Map<java.lang.String,java.lang.String>
headers(RequestT request)
Build the headers for a requestboolean
isError(int statusCode)
java.lang.String
method(RequestT request)
The endpoint's http methoddefault java.util.Map<java.lang.String,java.lang.String>
queryParameters(RequestT request)
Build the query parameters for a requestjava.lang.String
requestUrl(RequestT request)
Build the URL path for a requestJsonpDeserializer<ResponseT>
responseParser()
The entity parser for the response body.
-
Method Details
-
method
The endpoint's http method -
requestUrl
Build the URL path for a request -
queryParameters
Build the query parameters for a request -
headers
Build the headers for a request -
hasRequestBody
boolean hasRequestBody() -
responseParser
The entity parser for the response body. Can benull
to indicate that there's no response body. -
isError
boolean isError(int statusCode) -
errorParser
The entity parser for the error response body. Can benull
to indicate that there's no error body.
-