GlobalSearchApplicationInfo.Builder


class GlobalSearchApplicationInfo.Builder


Builder class for GlobalSearchApplicationInfo.

Summary

Public constructors

Builder(namespace: String, id: String, applicationType: Int)

Constructs a new Builder.

Public functions

GlobalSearchApplicationInfo

Constructs a new GlobalSearchApplicationInfo.

GlobalSearchApplicationInfo.Builder
setDocumentClasses(schemaClasses: (Mutable)List<Class<Any!>>)

Sets the list of schemas this app is capable of producing (if getApplicationType is APPLICATION_TYPE_PRODUCER) or interested in consuming (if is #APPLICATION_TYPE_CONSUMER).

GlobalSearchApplicationInfo.Builder

Sets the list of schema type names this app is capable of producing (if getApplicationType is APPLICATION_TYPE_PRODUCER) or interested in consuming (if is #APPLICATION_TYPE_CONSUMER).

Public constructors

Builder

Added in 1.1.0-beta01
Builder(namespace: String, id: String, applicationType: Int)

Constructs a new Builder.

Parameters
namespace: String

an arbitrary string corresponding to a logical grouping for this GlobalSearchApplicationInfo. All AppSearch documents must have a namespace.

id: String

the identifier for this GlobalSearchApplicationInfo. AppSearch IDs are unique within their combination of package, database and namespace.

applicationType: Int

whether the application is capable of producing, or interested in consuming, the schema types configured by setSchemaTypes or setDocumentClasses.

Public functions

setDocumentClasses

Added in 1.1.0-beta01
fun setDocumentClasses(schemaClasses: (Mutable)List<Class<Any!>>): GlobalSearchApplicationInfo.Builder

Sets the list of schemas this app is capable of producing (if getApplicationType is APPLICATION_TYPE_PRODUCER) or interested in consuming (if is #APPLICATION_TYPE_CONSUMER).

This method is equivalent to setSchemaTypes but accepts document classes instead of schema name strings.

Parameters
schemaClasses: (Mutable)List<Class<Any!>>

A list of classes annotated with the @Document annotation which correspond to the schemas this app produces or consumes.

Throws
androidx.appsearch.exceptions.AppSearchException

if the schemaClasses are not @Document-annotated classes or extraction of the schema name fails.

setSchemaTypes

Added in 1.1.0-beta01
fun setSchemaTypes(schemaTypes: (Mutable)List<String>): GlobalSearchApplicationInfo.Builder

Sets the list of schema type names this app is capable of producing (if getApplicationType is APPLICATION_TYPE_PRODUCER) or interested in consuming (if is #APPLICATION_TYPE_CONSUMER).

This method is equivalent to setDocumentClasses but accepts schema name strings instead of extracting schema information from document classes.