Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/app/appsearch/GenericDocument#nestedclasses) \| [Protected Ctors](https://developer.android.com/reference/android/app/appsearch/GenericDocument#proctors) \| [Methods](https://developer.android.com/reference/android/app/appsearch/GenericDocument#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/app/appsearch/GenericDocument#inhmethods)

# GenericDocument

*** ** * ** ***

` public class GenericDocument `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

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

Known direct subclasses [AppSearchAccount](https://developer.android.com/reference/android/app/appsearch/AppSearchAccount) [AppSearchAccount](https://developer.android.com/reference/android/app/appsearch/AppSearchAccount) Encapsulates a `https://developer.android.com/reference/android/app/appsearch/GenericDocument` representing an `https://developer.android.com/reference/android/accounts/Account`.   

*** ** * ** ***

Represents a document unit.

Documents contain structured data conforming to their `https://developer.android.com/reference/android/app/appsearch/AppSearchSchema` type. Each document is uniquely identified by a namespace and a String ID within that namespace.

Documents are constructed by using the `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder`.
**See also:**

- `https://developer.android.com/reference/android/app/appsearch/AppSearchSession#put(android.app.appsearch.PutDocumentsRequest,%20java.util.concurrent.Executor,%20android.app.appsearch.BatchResultCallback<java.lang.String,java.lang.Void>)`
- `https://developer.android.com/reference/android/app/appsearch/AppSearchSession#getByDocumentId(android.app.appsearch.GetByDocumentIdRequest,%20java.util.concurrent.Executor,%20android.app.appsearch.BatchResultCallback<java.lang.String,android.app.appsearch.GenericDocument>)`
- `https://developer.android.com/reference/android/app/appsearch/AppSearchSession#search(java.lang.String,%20android.app.appsearch.SearchSpec)`

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder<BuilderType extends https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder<BuilderType>>` The builder class for `https://developer.android.com/reference/android/app/appsearch/GenericDocument`. |

| ### Protected constructors ||
|---|---|
| ` https://developer.android.com/reference/android/app/appsearch/GenericDocument#GenericDocument(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/GenericDocument` from an existing instance. |

| ### Public methods ||
|---|---|
| ` 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. |

### Inherited methods

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

## Protected constructors

### GenericDocument

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
protected GenericDocument (GenericDocument document)
```

Creates a new `https://developer.android.com/reference/android/app/appsearch/GenericDocument` from an existing instance.

This method should be only used by constructor of a subclass.

<br />

| Parameters ||
|---|---|
| `document` | `GenericDocument`: This value cannot be `null`. <br /> |

## Public methods

### equals

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean equals (Object other)
```

Indicates whether some other object is "equal to" this one.

The `equals` method implements an equivalence relation on non-null object references:

- It is *reflexive*: for any non-null reference value `x`, `x.equals(x)` should return `true`.
- It is *symmetric*: for any non-null reference values `x` and `y`, `x.equals(y)` should return `true` if and only if `y.equals(x)` returns `true`.
- It is *transitive*: for any non-null reference values `x`, `y`, and `z`, if `x.equals(y)` returns `true` and `y.equals(z)` returns `true`, then `x.equals(z)` should return `true`.
- It is *consistent*: for any non-null reference values `x` and `y`, multiple invocations of `x.equals(y)` consistently return `true` or consistently return `false`, provided no information used in `equals` comparisons on the objects is modified.
- For any non-null reference value `x`, `x.equals(null)` should return `false`.

An equivalence relation partitions the elements it operates on into *equivalence classes*; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

<br />

| Parameters ||
|---|---|
| `other` | `Object`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this object is the same as the obj argument; `false` otherwise. <br /> |

### getCreationTimestampMillis

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getCreationTimestampMillis ()
```

Returns the creation timestamp of the `https://developer.android.com/reference/android/app/appsearch/GenericDocument`, in milliseconds.

The value is in the `https://developer.android.com/reference/java/lang/System#currentTimeMillis()` time base.   

Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.

<br />

| Returns ||
|---|---|
| `long` | Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z. <br /> |

### getId

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getId ()
```

Returns the unique identifier of the `https://developer.android.com/reference/android/app/appsearch/GenericDocument`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. <br /> |

### getMaxIndexedProperties

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static int getMaxIndexedProperties ()
```

The maximum number of indexed properties a document can have.

Indexed properties are properties which are strings where the `https://developer.android.com/reference/android/app/appsearch/AppSearchSchema.StringPropertyConfig#getIndexingType()` value is anything other than `https://developer.android.com/reference/android/app/appsearch/AppSearchSchema.StringPropertyConfig#INDEXING_TYPE_NONE`, as well as long properties where the `https://developer.android.com/reference/android/app/appsearch/AppSearchSchema.LongPropertyConfig#getIndexingType()` value is `https://developer.android.com/reference/android/app/appsearch/AppSearchSchema.LongPropertyConfig#INDEXING_TYPE_RANGE`.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getNamespace

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getNamespace ()
```

Returns the namespace of the `https://developer.android.com/reference/android/app/appsearch/GenericDocument`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. <br /> |

### getProperty

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Object getProperty (String path)
```

Retrieves the property value with the given path as `https://developer.android.com/reference/java/lang/Object`.

A path can be a simple property name, such as those returned by `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyNames()`. It may also be a dot-delimited path through the nested document hierarchy, with nested `https://developer.android.com/reference/android/app/appsearch/GenericDocument` properties accessed via `'.'` and repeated properties optionally indexed into via `[n]`.

For example, given the following `https://developer.android.com/reference/android/app/appsearch/GenericDocument`:

```
    (Message) {
        from: "sender@example.com"
        to: [{
            name: "Albert Einstein"
            email: "einstein@example.com"
          }, {
            name: "Marie Curie"
            email: "curie@example.com"
          }]
        tags: ["important", "inbox"]
        subject: "Hello"
    }
```

Here are some example paths and their results:

- `"from"` returns `"sender@example.com"` as a `https://developer.android.com/reference/java/lang/String` array with one element
- `"to"` returns the two nested documents containing contact information as a `https://developer.android.com/reference/android/app/appsearch/GenericDocument` array with two elements
- `"to[1]"` returns the second nested document containing Marie Curie's contact information as a `https://developer.android.com/reference/android/app/appsearch/GenericDocument` array with one element
- `"to[1].email"` returns `"curie@example.com"`
- `"to[100].email"` returns `null` as this particular document does not have that many elements in its `"to"` array.
- `"to.email"` aggregates emails across all nested documents that have them, returning `["einstein@example.com", "curie@example.com"]` as a `https://developer.android.com/reference/java/lang/String` array with two elements.

If you know the expected type of the property you are retrieving, it is recommended to use one of the typed versions of this method instead, such as `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyString(java.lang.String)` or `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getPropertyStringArray(java.lang.String)`.

If the property was assigned as an empty array using one of the `Builder#setProperty` functions, this method will return an empty array. If no such property exists at all, this method returns `null`.

Note: If the property is an empty `https://developer.android.com/reference/android/app/appsearch/GenericDocument`\[\] or `byte[][]`, this method will return a `null` value in versions of Android prior to `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU`. Starting in Android T it will return an empty array if the property has been set as an empty array, matching the behavior of other property types.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/Object` | The entry with the given path as an object or `null` if there is no such path. The returned object will be one of the following types: `String[]`, `long[]`, `double[]`, `boolean[]`, `byte[][]`, `GenericDocument[]`. <br /> |

### getPropertyBlobHandle

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

```
public AppSearchBlobHandle getPropertyBlobHandle (String path)
```

Retrieves an `https://developer.android.com/reference/android/app/appsearch/AppSearchBlobHandle` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

See `https://developer.android.com/reference/android/app/appsearch/AppSearchSession#openBlobForRead(java.util.Set<android.app.appsearch.AppSearchBlobHandle>,%20java.util.concurrent.Executor,%20java.util.function.Consumer<android.app.appsearch.AppSearchResult<android.app.appsearch.OpenBlobForReadResponse>>)` for how to use `https://developer.android.com/reference/android/app/appsearch/AppSearchBlobHandle` to retrieve blob data.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/appsearch/AppSearchBlobHandle` | The first `https://developer.android.com/reference/android/app/appsearch/AppSearchBlobHandle` associated with the given path or `null` if there is no such value or the value is of a different type. <br /> |

### getPropertyBlobHandleArray

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

```
public AppSearchBlobHandle[] getPropertyBlobHandleArray (String path)
```

Retrieves a repeated `AppSearchBlobHandle[]` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

If the property has not been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyBlobHandle(java.lang.String,%20android.app.appsearch.AppSearchBlobHandle[])`, this method returns `null`.

If it has been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyBlobHandle(java.lang.String,%20android.app.appsearch.AppSearchBlobHandle[])` to an empty `AppSearchBlobHandle[]`, this method returns an empty `AppSearchBlobHandle[]`.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/appsearch/AppSearchBlobHandle` | The `AppSearchBlobHandle[]` associated with the given path, or `null` if no value is set or the value is of a different type. <br /> |

### getPropertyBoolean

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean getPropertyBoolean (String path)
```

Retrieves a `boolean` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | The first `boolean` associated with the given path or default value `false` if there is no such value or the value is of a different type. <br /> |

### getPropertyBooleanArray

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean[] getPropertyBooleanArray (String path)
```

Retrieves a repeated `boolean` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

If the property has not been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyBoolean(java.lang.String,%20boolean[])`, this method returns `null`.

If it has been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyBoolean(java.lang.String,%20boolean[])` to an empty `boolean[]`, this method returns an empty `boolean[]`.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean[]` | The `boolean[]` associated with the given path, or `null` if no value is set or the value is of a different type. <br /> |

### getPropertyBytes

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public byte[] getPropertyBytes (String path)
```

Retrieves a `byte[]` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `byte[]` | The first `byte[]` associated with the given path or `null` if there is no such value or the value is of a different type. <br /> |

### getPropertyBytesArray

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public byte[][] getPropertyBytesArray (String path)
```

Retrieves a `byte[][]` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

If the property has not been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyBytes(java.lang.String,%20byte[][])`, this method returns `null`.

If it has been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyBytes(java.lang.String,%20byte[][])` to an empty `byte[][]`, this method returns an empty `byte[][]` starting in `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU` and `null` in earlier versions of Android.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `byte[][]` | The `byte[][]` associated with the given path, or `null` if no value is set or the value is of a different type. <br /> |

### getPropertyDocument

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public GenericDocument getPropertyDocument (String path)
```

Retrieves a `https://developer.android.com/reference/android/app/appsearch/GenericDocument` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/appsearch/GenericDocument` | The first `https://developer.android.com/reference/android/app/appsearch/GenericDocument` associated with the given path or `null` if there is no such value or the value is of a different type. <br /> |

### getPropertyDocumentArray

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public GenericDocument[] getPropertyDocumentArray (String path)
```

Retrieves a repeated `https://developer.android.com/reference/android/app/appsearch/GenericDocument` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

If the property has not been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyDocument(java.lang.String,%20android.app.appsearch.GenericDocument[])`, this method returns `null`.

If it has been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyDocument(java.lang.String,%20android.app.appsearch.GenericDocument[])` to an empty `GenericDocument[]`, this method returns an empty `GenericDocument[]` starting in `https://developer.android.com/reference/android/os/Build.VERSION_CODES#TIRAMISU` and `null` in earlier versions of Android.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/appsearch/GenericDocument` | The `https://developer.android.com/reference/android/app/appsearch/GenericDocument`\[\] associated with the given path, or `null` if no value is set or the value is of a different type. <br /> |

### getPropertyDouble

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public double getPropertyDouble (String path)
```

Retrieves a `double` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `double` | The first `double` associated with the given path or default value `0.0` if there is no such value or the value is of a different type. <br /> |

### getPropertyDoubleArray

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public double[] getPropertyDoubleArray (String path)
```

Retrieves a repeated `double` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

If the property has not been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyDouble(java.lang.String,%20double[])`, this method returns `null`.

If it has been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyDouble(java.lang.String,%20double[])` to an empty `double[]`, this method returns an empty `double[]`.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `double[]` | The `double[]` associated with the given path, or `null` if no value is set or the value is of a different type. <br /> |

### getPropertyEmbedding

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

```
public EmbeddingVector getPropertyEmbedding (String path)
```

Retrieves an `EmbeddingVector` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/appsearch/EmbeddingVector` | The first `EmbeddingVector[]` associated with the given path or `null` if there is no such value or the value is of a different type. <br /> |

### getPropertyEmbeddingArray

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

```
public EmbeddingVector[] getPropertyEmbeddingArray (String path)
```

Retrieves a repeated `EmbeddingVector[]` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

If the property has not been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyEmbedding(java.lang.String,%20android.app.appsearch.EmbeddingVector[])`, this method returns `null`.

If it has been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyEmbedding(java.lang.String,%20android.app.appsearch.EmbeddingVector[])` to an empty `EmbeddingVector[]`, this method returns an empty `EmbeddingVector[]`.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/app/appsearch/EmbeddingVector` | The `EmbeddingVector[]` associated with the given path, or `null` if no value is set or the value is of a different type. <br /> |

### getPropertyLong

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getPropertyLong (String path)
```

Retrieves a `long` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `long` | The first `long` associated with the given path or default value `0` if there is no such value or the value is of a different type. <br /> |

### getPropertyLongArray

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long[] getPropertyLongArray (String path)
```

Retrieves a repeated `long[]` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

If the property has not been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyLong(java.lang.String,%20long[])`, this method returns `null`.

If it has been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyLong(java.lang.String,%20long[])` to an empty `long[]`, this method returns an empty `long[]`.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `long[]` | The `long[]` associated with the given path, or `null` if no value is set or the value is of a different type. <br /> |

### getPropertyNames

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<String> getPropertyNames ()
```

Returns the names of all properties defined in this document.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/java/lang/String>` | This value cannot be `null`. <br /> |

### getPropertyString

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getPropertyString (String path)
```

Retrieves a `https://developer.android.com/reference/java/lang/String` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The first `https://developer.android.com/reference/java/lang/String` associated with the given path or `null` if there is no such value or the value is of a different type. <br /> |

### getPropertyStringArray

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String[] getPropertyStringArray (String path)
```

Retrieves a repeated `String` property by path.

See `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getProperty(java.lang.String)` for a detailed description of the path syntax.

If the property has not been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyString(java.lang.String,%20java.lang.String[])`, this method returns `null`.

If it has been set via `https://developer.android.com/reference/android/app/appsearch/GenericDocument.Builder#setPropertyString(java.lang.String,%20java.lang.String[])` to an empty `String[]`, this method returns an empty `String[]`.

<br />

| Parameters ||
|---|---|
| `path` | `String`: The path to look for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The `String[]` associated with the given path, or `null` if no value is set or the value is of a different type. <br /> |

### getSchemaType

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getSchemaType ()
```

Returns the `https://developer.android.com/reference/android/app/appsearch/AppSearchSchema` type of the `https://developer.android.com/reference/android/app/appsearch/GenericDocument`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. <br /> |

### getScore

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getScore ()
```

Returns the score of the `https://developer.android.com/reference/android/app/appsearch/GenericDocument`.

The score is a query-independent measure of the document's quality, relative to other `https://developer.android.com/reference/android/app/appsearch/GenericDocument` objects of the same `https://developer.android.com/reference/android/app/appsearch/AppSearchSchema` type.

Results may be sorted by score using `https://developer.android.com/reference/android/app/appsearch/SearchSpec.Builder#setRankingStrategy(int)`. Documents with higher scores are considered better than documents with lower scores.

Any non-negative integer can be used a score.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getTtlMillis

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long getTtlMillis ()
```

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

The TTL is measured against `https://developer.android.com/reference/android/app/appsearch/GenericDocument#getCreationTimestampMillis()`. At the timestamp of `creationTimestampMillis + ttlMillis`, measured in the `https://developer.android.com/reference/java/lang/System#currentTimeMillis()` time base, the document will be auto-deleted.

The default value is 0, which means the document is permanent and won't be auto-deleted until the app is uninstalled or `https://developer.android.com/reference/android/app/appsearch/AppSearchSession#remove(android.app.appsearch.RemoveByDocumentIdRequest,%20java.util.concurrent.Executor,%20android.app.appsearch.BatchResultCallback<java.lang.String,java.lang.Void>)` is called.

<br />

| Returns ||
|---|---|
| `long` | <br /> |

### hashCode

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int hashCode ()
```

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by `https://developer.android.com/reference/java/util/HashMap`.

The general contract of `hashCode` is:

- Whenever it is invoked on the same object more than once during an execution of a Java application, the `hashCode` method must consistently return the same integer, provided no information used in `equals` comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce the same integer result.
- It is *not* required that if two objects are unequal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

<br />

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### toString

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | This value cannot be `null`. <br /> |