public final class

LocalStorage.SearchContext.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.appsearch.localstorage.LocalStorage.SearchContext.Builder

Overview

Builder for LocalStorage.SearchContext objects.

Summary

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

Creates a LocalStorage.SearchContext.Builder instance.

Methods
public LocalStorage.SearchContextbuild()

Builds a LocalStorage.SearchContext instance.

public LocalStorage.SearchContext.BuildersetLogger(AppSearchLogger logger)

Sets the custom logger used to get the details stats from AppSearch.

public LocalStorage.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 LocalStorage.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 '/'.

Parameters:

databaseName: The name of the database.

Methods

public LocalStorage.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.

Sets the custom logger used to get the details stats from AppSearch.

If no logger is provided, nothing would be returned/logged. There is no default logger implementation in AppSearch.

Builds a LocalStorage.SearchContext instance.