GetByDocumentIdRequest.Builder

public static final class GetByDocumentIdRequest.Builder
extends Object

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


Builder for GetByDocumentIdRequest objects.

Summary

Public constructors

Builder(String namespace)

Creates a GetByDocumentIdRequest.Builder instance.

Public methods

GetByDocumentIdRequest.Builder addIds(String... ids)

Adds one or more document IDs to the request.

GetByDocumentIdRequest.Builder addIds(Collection<String> ids)

Adds a collection of IDs to the request.

GetByDocumentIdRequest.Builder addProjection(String schemaType, Collection<String> propertyPaths)

Adds property paths for the specified type to be used for projection.

GetByDocumentIdRequest build()

Builds a new GetByDocumentIdRequest.

Inherited methods

Public constructors

Builder

public Builder (String namespace)

Creates a GetByDocumentIdRequest.Builder instance.

Parameters
namespace String

Public methods

addIds

public GetByDocumentIdRequest.Builder addIds (String... ids)

Adds one or more document IDs to the request.

Parameters
ids String

Returns
GetByDocumentIdRequest.Builder

addIds

public GetByDocumentIdRequest.Builder addIds (Collection<String> ids)

Adds a collection of IDs to the request.

Parameters
ids Collection

Returns
GetByDocumentIdRequest.Builder

addProjection

public GetByDocumentIdRequest.Builder addProjection (String schemaType, 
                Collection<String> propertyPaths)

Adds property paths for the specified type to be used for projection. If property paths are added for a type, then only the properties referred to will be retrieved for results of that type. If a property path that is specified isn't present in a result, it will be ignored for that result. Property paths cannot be null.

If no property paths are added for a particular type, then all properties of results of that type will be retrieved.

If property path is added for the GetByDocumentIdRequest.PROJECTION_SCHEMA_TYPE_WILDCARD, then those property paths will apply to all results, excepting any types that have their own, specific property paths set.

Parameters
schemaType String

propertyPaths Collection

Returns
GetByDocumentIdRequest.Builder

build

public GetByDocumentIdRequest build ()

Builds a new GetByDocumentIdRequest.

Returns
GetByDocumentIdRequest