PutDocumentsRequest.Builder

public static final class PutDocumentsRequest.Builder
extends Object

java.lang.Object
   ↳ androidx.appsearch.app.PutDocumentsRequest.Builder


Builder for PutDocumentsRequest objects.

Once build() is called, the instance can no longer be used.

Summary

Public constructors

Builder()

Public methods

PutDocumentsRequest.Builder addDocuments(Collection<?> documents)

Adds a collection of annotated Document documents to the request.

PutDocumentsRequest.Builder addDocuments(Object... documents)

Adds one or more annotated Document documents to the request.

PutDocumentsRequest.Builder addGenericDocuments(Collection<? extends GenericDocument> documents)

Adds a collection of GenericDocument objects to the request.

PutDocumentsRequest.Builder addGenericDocuments(GenericDocument... documents)

Adds one or more GenericDocument objects to the request.

PutDocumentsRequest build()

Creates a new PutDocumentsRequest object.

Inherited methods

Public constructors

Builder

public Builder ()

Public methods

addDocuments

public PutDocumentsRequest.Builder addDocuments (Collection<?> documents)

Adds a collection of annotated Document documents to the request.

Parameters
documents Collection: annotated Document documents.

Returns
PutDocumentsRequest.Builder

Throws
AppSearchException if an error occurs converting a document into a GenericDocument.
IllegalStateException if the builder has already been used.

addDocuments

public PutDocumentsRequest.Builder addDocuments (Object... documents)

Adds one or more annotated Document documents to the request.

Parameters
documents Object: annotated Document documents.

Returns
PutDocumentsRequest.Builder

Throws
AppSearchException if an error occurs converting a document class into a GenericDocument.
IllegalStateException if the builder has already been used.

addGenericDocuments

public PutDocumentsRequest.Builder addGenericDocuments (Collection<? extends GenericDocument> documents)

Adds a collection of GenericDocument objects to the request.

Parameters
documents Collection

Returns
PutDocumentsRequest.Builder

Throws
IllegalStateException if the builder has already been used.

addGenericDocuments

public PutDocumentsRequest.Builder addGenericDocuments (GenericDocument... documents)

Adds one or more GenericDocument objects to the request.

Parameters
documents GenericDocument

Returns
PutDocumentsRequest.Builder

Throws
IllegalStateException if the builder has already been used.

build

public PutDocumentsRequest build ()

Creates a new PutDocumentsRequest object.

Returns
PutDocumentsRequest

Throws
IllegalStateException if the builder has already been used.