AppSearchAccount


public final class AppSearchAccount
extends GenericDocument

java.lang.Object
   ↳ android.app.appsearch.GenericDocument
     ↳ android.app.appsearch.AppSearchAccount


Encapsulates a GenericDocument representing an Account.

In AppSearch, an Account is used to partition data and manage its lifecycle. By associating indexed documents with an AppSearchAccount, the system can perform automated wipeout documents when an account is removed from the device.

This class provides a standardized way for AppSearch to recognize which data belongs to which user identity in multi-login or synced environments.

This class is a higher level implement of GenericDocument.

Summary

Nested classes

class AppSearchAccount.Builder

The builder class for AppSearchAccount

Constants

String SCHEMA_TYPE

The name of the schema type for AppSearchAccount documents.

Fields

public static final AppSearchSchema SCHEMA

Public constructors

AppSearchAccount(GenericDocument document)

Creates a new AppSearchAccount from the contents of an existing GenericDocument.

Public methods

String getAccountId()

Gets the account id of AppSearchAccount or null if it's not been set yet.

String getAccountName()

Gets the name of AppSearchAccount or null if it's not been set yet.

String getAccountType()

Gets the type of AppSearchAccount or null if it's not been set yet.

Inherited methods

Constants

SCHEMA_TYPE

Added in API level 37
Also in T Extensions 22
public static final String SCHEMA_TYPE

The name of the schema type for AppSearchAccount documents.

Constant Value: "builtin:Account"

Fields

SCHEMA

Added in API level 37
Also in T Extensions 22
public static final AppSearchSchema SCHEMA

Public constructors

AppSearchAccount

Added in API level 37
Also in T Extensions 22
public AppSearchAccount (GenericDocument document)

Creates a new AppSearchAccount from the contents of an existing GenericDocument.

Parameters
document GenericDocument: The GenericDocument containing the Account content.
This value cannot be null.

Public methods

getAccountId

Added in API level 37
Also in T Extensions 22
public String getAccountId ()

Gets the account id of AppSearchAccount or null if it's not been set yet.

Returns
String

getAccountName

Added in API level 37
Also in T Extensions 22
public String getAccountName ()

Gets the name of AppSearchAccount or null if it's not been set yet.

Returns
String

getAccountType

Added in API level 37
Also in T Extensions 22
public String getAccountType ()

Gets the type of AppSearchAccount or null if it's not been set yet.

Returns
String