public final class

PlatformStorage.SearchContext.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.appsearch.platformstorage.PlatformStorage.SearchContext.Builder

Overview

Builder for PlatformStorage.SearchContext objects.

Summary

Constructors
publicBuilder(Context context, java.lang.String databaseName)

Creates a PlatformStorage.SearchContext.Builder instance.

Methods
public PlatformStorage.SearchContextbuild()

Builds a PlatformStorage.SearchContext instance.

public PlatformStorage.SearchContext.BuildersetWorkerExecutor(java.util.concurrent.Executor executor)

Sets the worker executor associated with AppSearchSession.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(Context context, java.lang.String databaseName)

Creates a PlatformStorage.SearchContext.Builder instance.

AppSearchSession will create or open a database under the given name.

Databases with different names are fully separate with distinct schema types, namespaces, and documents.

The database name cannot contain '/'.

The database name will be visible to all system UI or third-party applications that have been granted access to any of the database's documents (for example, using SetSchemaRequest.Builder.setSchemaTypeVisibilityForPackage(String, boolean, PackageIdentifier)).

Parameters:

databaseName: The name of the database.

Methods

public PlatformStorage.SearchContext.Builder setWorkerExecutor(java.util.concurrent.Executor executor)

Sets the worker executor associated with AppSearchSession.

If an executor is not provided, the AppSearch default executor will be used.

Parameters:

executor: the worker executor used to run heavy background tasks.

Builds a PlatformStorage.SearchContext instance.