Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [T Extensions 22](https://developer.android.com/sdkExtensions) Summary: [Nested Classes](https://developer.android.com/reference/android/app/appsearch/AppSearchAccount#nestedclasses) \| [Constants](https://developer.android.com/reference/android/app/appsearch/AppSearchAccount#constants) \| [Fields](https://developer.android.com/reference/android/app/appsearch/AppSearchAccount#lfields) \| [Ctors](https://developer.android.com/reference/android/app/appsearch/AppSearchAccount#pubctors) \| [Methods](https://developer.android.com/reference/android/app/appsearch/AppSearchAccount#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/appsearch/AppSearchAccount#inhmethods)

# AppSearchAccount

*** ** * ** ***

` public final class AppSearchAccount `   
` ` ` extends https://developer.android.com/reference/android/app/appsearch/GenericDocument ` ` `

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||
| ↳ | [android.app.appsearch.GenericDocument](https://developer.android.com/reference/android/app/appsearch/GenericDocument) ||
|   | ↳ | android.app.appsearch.AppSearchAccount |

<br />

*** ** * ** ***

Encapsulates a `https://developer.android.com/reference/android/app/appsearch/GenericDocument` representing an `https://developer.android.com/reference/android/accounts/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 `https://developer.android.com/reference/android/app/appsearch/GenericDocument`.

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/app/appsearch/AppSearchAccount.Builder` The builder class for `https://developer.android.com/reference/android/app/appsearch/AppSearchAccount`. |

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/app/appsearch/AppSearchAccount#SCHEMA_TYPE` The name of the schema type for `https://developer.android.com/reference/android/app/appsearch/AppSearchAccount` documents. |

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/app/appsearch/AppSearchSchema` | `https://developer.android.com/reference/android/app/appsearch/AppSearchAccount#SCHEMA` <br /> |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/app/appsearch/AppSearchAccount#AppSearchAccount(android.app.appsearch.GenericDocument)(https://developer.android.com/reference/android/app/appsearch/GenericDocument document) ` Creates a new `https://developer.android.com/reference/android/app/appsearch/AppSearchAccount` from the contents of an existing `https://developer.android.com/reference/android/app/appsearch/GenericDocument`. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/app/appsearch/AppSearchAccount#getAccountId()() ` Gets the account id of `https://developer.android.com/reference/android/app/appsearch/AppSearchAccount` or `null` if it's not been set yet. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/app/appsearch/AppSearchAccount#getAccountName()() ` Gets the name of `https://developer.android.com/reference/android/app/appsearch/AppSearchAccount` or `null` if it's not been set yet. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/app/appsearch/AppSearchAccount#getAccountType()() ` Gets the type of `https://developer.android.com/reference/android/app/appsearch/AppSearchAccount` or `null` if it's not been set yet. |

### Inherited methods

From class ` https://developer.android.com/reference/android/app/appsearch/GenericDocument ` ` boolean` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object other) `

Indicates whether some other object is "equal to" this one.
` long` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getCreationTimestampMillis()() `

Returns the creation timestamp of the `https://developer.android.com/reference/android/app/appsearch/GenericDocument`, in milliseconds.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getId()() `

Returns the unique identifier of the `https://developer.android.com/reference/android/app/appsearch/GenericDocument`.
` static int` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getMaxIndexedProperties()() `

The maximum number of indexed properties a document can have.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getNamespace()() `

Returns the namespace of the `https://developer.android.com/reference/android/app/appsearch/GenericDocument`.
` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves the property value with the given path as `https://developer.android.com/reference/java/lang/Object`.
` https://developer.android.com/reference/android/app/appsearch/AppSearchBlobHandle` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyBlobHandle(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves an `https://developer.android.com/reference/android/app/appsearch/AppSearchBlobHandle` property by path.
` https://developer.android.com/reference/android/app/appsearch/AppSearchBlobHandle` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyBlobHandleArray(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves a repeated `AppSearchBlobHandle[]` property by path.
` boolean` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyBoolean(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves a `boolean` property by path.
` boolean[]` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyBooleanArray(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves a repeated `boolean` property by path.
` byte[]` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyBytes(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves a `byte[]` property by path.
` byte[][]` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyBytesArray(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves a `byte[][]` property by path.
` https://developer.android.com/reference/android/app/appsearch/GenericDocument` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyDocument(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves a `https://developer.android.com/reference/android/app/appsearch/GenericDocument` property by path.
` https://developer.android.com/reference/android/app/appsearch/GenericDocument` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyDocumentArray(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves a repeated `https://developer.android.com/reference/android/app/appsearch/GenericDocument` property by path.
` double` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyDouble(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves a `double` property by path.
` double[]` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyDoubleArray(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves a repeated `double` property by path.
` https://developer.android.com/reference/android/app/appsearch/EmbeddingVector` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyEmbedding(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves an `EmbeddingVector` property by path.
` https://developer.android.com/reference/android/app/appsearch/EmbeddingVector` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyEmbeddingArray(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves a repeated `EmbeddingVector[]` property by path.
` long` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyLong(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves a `long` property by path.
` long[]` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyLongArray(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves a repeated `long[]` property by path.
` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/lang/String>` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyNames()() `

Returns the names of all properties defined in this document.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyString(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves a `https://developer.android.com/reference/java/lang/String` property by path.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyStringArray(java.lang.String)(https://developer.android.com/reference/java/lang/String path) `

Retrieves a repeated `String` property by path.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getSchemaType()() `

Returns the `https://developer.android.com/reference/android/app/appsearch/AppSearchSchema` type of the `https://developer.android.com/reference/android/app/appsearch/GenericDocument`.
` int` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getScore()() `

Returns the score of the `https://developer.android.com/reference/android/app/appsearch/GenericDocument`.
` long` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#getTtlMillis()() `

Returns the TTL (time-to-live) of the `https://developer.android.com/reference/android/app/appsearch/GenericDocument`, in milliseconds.
` int` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#hashCode()() `

Returns a hash code value for the object.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#toString()() `

Returns a string representation of the object.
From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Constants

### SCHEMA_TYPE

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [T Extensions 22](https://developer.android.com/sdkExtensions)

```
public static final String SCHEMA_TYPE
```

The name of the schema type for `https://developer.android.com/reference/android/app/appsearch/AppSearchAccount` documents.

<br />

Constant Value: "builtin:Account"

## Fields

### SCHEMA

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [T Extensions 22](https://developer.android.com/sdkExtensions)

```
public static final AppSearchSchema SCHEMA
```

<br />

<br />

## Public constructors

### AppSearchAccount

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [T Extensions 22](https://developer.android.com/sdkExtensions)

```
public AppSearchAccount (GenericDocument document)
```

Creates a new `https://developer.android.com/reference/android/app/appsearch/AppSearchAccount` from the contents of an existing `https://developer.android.com/reference/android/app/appsearch/GenericDocument`.

<br />

| Parameters ||
|---|---|
| `document` | `GenericDocument`: The `https://developer.android.com/reference/android/app/appsearch/GenericDocument` containing the Account content. This value cannot be `null`. <br /> |

## Public methods

### getAccountId

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [T Extensions 22](https://developer.android.com/sdkExtensions)

```
public String getAccountId ()
```

Gets the account id of `https://developer.android.com/reference/android/app/appsearch/AppSearchAccount` or `null` if it's not been set yet.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getAccountName

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [T Extensions 22](https://developer.android.com/sdkExtensions)

```
public String getAccountName ()
```

Gets the name of `https://developer.android.com/reference/android/app/appsearch/AppSearchAccount` or `null` if it's not been set yet.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getAccountType

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [T Extensions 22](https://developer.android.com/sdkExtensions)

```
public String getAccountType ()
```

Gets the type of `https://developer.android.com/reference/android/app/appsearch/AppSearchAccount` or `null` if it's not been set yet.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |