Class MgetResponse.Builder<TDocument>
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<MgetResponse.Builder<TDocument>>
co.elastic.clients.elasticsearch.core.MgetResponse.Builder<TDocument>
- All Implemented Interfaces:
WithJson<MgetResponse.Builder<TDocument>>
,ObjectBuilder<MgetResponse<TDocument>>
- Enclosing class:
- MgetResponse<TDocument>
public static class MgetResponse.Builder<TDocument>
extends WithJsonObjectBuilderBase<MgetResponse.Builder<TDocument>>
implements ObjectBuilder<MgetResponse<TDocument>>
Builder for
MgetResponse
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aMgetResponse
.final MgetResponse.Builder<TDocument>
docs
(MultiGetResponseItem<TDocument> value, MultiGetResponseItem<TDocument>... values) Required - The response includes a docs array that contains the documents in the order specified in the request.final MgetResponse.Builder<TDocument>
docs
(Function<MultiGetResponseItem.Builder<TDocument>, ObjectBuilder<MultiGetResponseItem<TDocument>>> fn) Required - The response includes a docs array that contains the documents in the order specified in the request.final MgetResponse.Builder<TDocument>
docs
(List<MultiGetResponseItem<TDocument>> list) Required - The response includes a docs array that contains the documents in the order specified in the request.protected MgetResponse.Builder<TDocument>
self()
final MgetResponse.Builder<TDocument>
Serializer for TDocument.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
docs
Required - The response includes a docs array that contains the documents in the order specified in the request. The structure of the returned documents is similar to that returned by the get API. If there is a failure getting a particular document, the error is included in place of the document.API name:
docs
Adds all elements of
list
todocs
. -
docs
public final MgetResponse.Builder<TDocument> docs(MultiGetResponseItem<TDocument> value, MultiGetResponseItem<TDocument>... values) Required - The response includes a docs array that contains the documents in the order specified in the request. The structure of the returned documents is similar to that returned by the get API. If there is a failure getting a particular document, the error is included in place of the document.API name:
docs
Adds one or more values to
docs
. -
docs
public final MgetResponse.Builder<TDocument> docs(Function<MultiGetResponseItem.Builder<TDocument>, ObjectBuilder<MultiGetResponseItem<TDocument>>> fn) Required - The response includes a docs array that contains the documents in the order specified in the request. The structure of the returned documents is similar to that returned by the get API. If there is a failure getting a particular document, the error is included in place of the document.API name:
docs
Adds a value to
docs
using a builder lambda. -
tDocumentSerializer
public final MgetResponse.Builder<TDocument> tDocumentSerializer(@Nullable JsonpSerializer<TDocument> value) Serializer for TDocument. If not set, an attempt will be made to find a serializer from the JSON context. -
self
- Specified by:
self
in classWithJsonObjectBuilderBase<MgetResponse.Builder<TDocument>>
-
build
Builds aMgetResponse
.- Specified by:
build
in interfaceObjectBuilder<TDocument>
- Throws:
NullPointerException
- if some of the required fields are null.
-