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.

T
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).

T

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
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

build

Added in 1.1.0
fun build(): GlobalSearchApplicationInfo

Constructs a new GlobalSearchApplicationInfo.

setDocumentClasses

Added in 1.1.0
fun setDocumentClasses(schemaClasses: (Mutable)List<Class<Any!>>): T

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
fun setSchemaTypes(schemaTypes: (Mutable)List<String>): T

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.

Protected properties

mApplicationType

protected val mApplicationTypeInt

mId

protected val mIdString!

mNamespace

protected val mNamespaceString!

mSchemaTypes

protected val mSchemaTypes: (Mutable)List<String!>!