Class SimpleEndpoint<RequestT,ResponseT>
java.lang.Object
co.elastic.clients.transport.endpoints.EndpointBase<RequestT,ResponseT>
co.elastic.clients.transport.endpoints.SimpleEndpoint<RequestT,ResponseT>
- All Implemented Interfaces:
Endpoint<RequestT,
,ResponseT, ErrorResponse> JsonEndpoint<RequestT,
ResponseT, ErrorResponse>
- Direct Known Subclasses:
SimpleJsonEndpoint
public class SimpleEndpoint<RequestT,ResponseT>
extends EndpointBase<RequestT,ResponseT>
implements JsonEndpoint<RequestT,ResponseT,ErrorResponse>
-
Field Summary
Fields inherited from class co.elastic.clients.transport.endpoints.EndpointBase
body, headers, id, method, pathParameters, queryParameters, requestUrl
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleEndpoint
(String id, Function<RequestT, String> method, Function<RequestT, String> requestUrl, Function<RequestT, Map<String, String>> pathParameters, Function<RequestT, Map<String, String>> queryParameters, Function<RequestT, Map<String, String>> headers, boolean hasRequestBody, JsonpDeserializer<ResponseT> responseParser) SimpleEndpoint
(String id, Function<RequestT, String> method, Function<RequestT, String> requestUrl, Function<RequestT, Map<String, String>> pathParameters, Function<RequestT, Map<String, String>> queryParameters, Function<RequestT, Map<String, String>> headers, Function<RequestT, Object> body, JsonpDeserializer<ResponseT> responseParser) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T,
U extends JsonpSerializable>
Function<T,Object> nonEmptyJsonObject
(Function<T, U> getter) Wraps a function's result with a serializable object that will serialize to nothing if the wrapped object's serialization has no property, i.e.The entity parser for the response body.<NewResponseT>
SimpleEndpoint<RequestT,NewResponseT> withResponseDeserializer
(JsonpDeserializer<NewResponseT> newResponseParser) Methods inherited from class co.elastic.clients.transport.endpoints.EndpointBase
body, emptyMap, errorDeserializer, headers, id, isError, method, noPathTemplateFound, pathEncode, pathParameters, queryParameters, requestUrl, returnSelf
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface co.elastic.clients.transport.Endpoint
body, call, call, callAsync, callAsync, errorDeserializer, headers, id, isError, method, pathParameters, queryParameters, requestUrl, withBinaryResponse
-
Constructor Details
-
SimpleEndpoint
public SimpleEndpoint(String id, Function<RequestT, String> method, Function<RequestT, String> requestUrl, Function<RequestT, Map<String, String>> pathParameters, Function<RequestT, Map<String, String>> queryParameters, Function<RequestT, Map<String, String>> headers, Function<RequestT, Object> body, JsonpDeserializer<ResponseT> responseParser) -
SimpleEndpoint
public SimpleEndpoint(String id, Function<RequestT, String> method, Function<RequestT, String> requestUrl, Function<RequestT, Map<String, String>> pathParameters, Function<RequestT, Map<String, String>> queryParameters, Function<RequestT, Map<String, String>> headers, boolean hasRequestBody, JsonpDeserializer<ResponseT> responseParser)
-
-
Method Details
-
responseDeserializer
Description copied from interface:JsonEndpoint
The entity parser for the response body.- Specified by:
responseDeserializer
in interfaceJsonEndpoint<RequestT,
ResponseT, ErrorResponse>
-
withResponseDeserializer
public <NewResponseT> SimpleEndpoint<RequestT,NewResponseT> withResponseDeserializer(JsonpDeserializer<NewResponseT> newResponseParser) - Overrides:
withResponseDeserializer
in classEndpointBase<RequestT,
ResponseT>
-
nonEmptyJsonObject
public static <T,U extends JsonpSerializable> Function<T,Object> nonEmptyJsonObject(Function<T, U> getter) Wraps a function's result with a serializable object that will serialize to nothing if the wrapped object's serialization has no property, i.e. it will either produce an empty object or nothing.
-