AppSearchDocumentClassMap


@AnyThread
public abstract class AppSearchDocumentClassMap


A class that maintains the map from schema type names to the fully qualified names of the corresponding document classes.

Summary

Public constructors

Public methods

static @NonNull Map<StringList<String>>

Returns the global map that includes all AppSearch document classes annotated with Document that are available in the current runtime.

Protected methods

abstract @NonNull Map<StringList<String>>

Returns the map from schema type names to the list of the fully qualified names of the corresponding document classes.

Public constructors

AppSearchDocumentClassMap

Added in 1.1.0-alpha07
public AppSearchDocumentClassMap()

Public methods

getGlobalMap

Added in 1.1.0-alpha07
@WorkerThread
public static @NonNull Map<StringList<String>> getGlobalMap()

Returns the global map that includes all AppSearch document classes annotated with Document that are available in the current runtime. It maps from AppSearch's type name specified by name to the list of the fully qualified names of the corresponding document classes. The values are lists because it is possible that two document classes are associated with the same AppSearch type name.

Note that although this method, under normal circumstances, executes quickly, it performs a synchronous disk read operation in order to build the map, which means it can potentially introduce I/O blocking if executed on the main thread.

Since every call to this method should return the same map, the value of this map will be internally cached, so that only the first call will perform disk I/O.

Protected methods

getMap

Added in 1.1.0-alpha07
protected abstract @NonNull Map<StringList<String>> getMap()

Returns the map from schema type names to the list of the fully qualified names of the corresponding document classes.