Class EndpointBase<RequestT,ResponseT>
java.lang.Object
co.elastic.clients.transport.endpoints.EndpointBase<RequestT,ResponseT>
- All Implemented Interfaces:
Endpoint<RequestT,ResponseT, ErrorResponse>
- Direct Known Subclasses:
BinaryEndpoint,BooleanEndpoint,SimpleEndpoint
public class EndpointBase<RequestT,ResponseT>
extends Object
implements Endpoint<RequestT,ResponseT,ErrorResponse>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionemptyMap()Returns a function that always returns an empty String to String map.errorDeserializer(int statusCode) The entity parser for the error response body.booleanGet the HTTP headers for a request.id()The endpoint's identifier.booleanisError(int statusCode) Is this status code to be considered as an error?Get the endpoint's HTTP method for a request.static RuntimeExceptionnoPathTemplateFound(String what) static voidpathEncode(String src, StringBuilder dest) queryParameters(RequestT request) Get the query parameters for a request.requestUrl(RequestT request) Get the URL path for a request.<NewResponseT>
SimpleEndpoint<RequestT,NewResponseT> withResponseDeserializer(JsonpDeserializer<NewResponseT> newResponseParser)
-
Field Details
-
id
-
method
-
requestUrl
-
queryParameters
-
headers
-
hasRequestBody
protected final boolean hasRequestBody
-
-
Constructor Details
-
EndpointBase
-
-
Method Details
-
emptyMap
Returns a function that always returns an empty String to String map. Useful to avoid creating lots of duplicate lambdas in endpoints that don't have headers or parameters. -
id
Description copied from interface:EndpointThe endpoint's identifier.- Specified by:
idin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
method
Description copied from interface:EndpointGet the endpoint's HTTP method for a request.- Specified by:
methodin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
requestUrl
Description copied from interface:EndpointGet the URL path for a request.- Specified by:
requestUrlin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
queryParameters
Description copied from interface:EndpointGet the query parameters for a request.- Specified by:
queryParametersin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
headers
Description copied from interface:EndpointGet the HTTP headers for a request.- Specified by:
headersin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
hasRequestBody
public boolean hasRequestBody()- Specified by:
hasRequestBodyin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
isError
public boolean isError(int statusCode) Description copied from interface:EndpointIs this status code to be considered as an error?- Specified by:
isErrorin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
errorDeserializer
Description copied from interface:EndpointThe entity parser for the error response body. Can benullto indicate that there's no error body.- Specified by:
errorDeserializerin interfaceEndpoint<RequestT,ResponseT, ErrorResponse>
-
withResponseDeserializer
public <NewResponseT> SimpleEndpoint<RequestT,NewResponseT> withResponseDeserializer(JsonpDeserializer<NewResponseT> newResponseParser) -
noPathTemplateFound
-
pathEncode
-