# DocumentIdUtil

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[T Extensions 7](https://developer.android.com/sdkExtensions)  
Summary:[Methods](https://developer.android.com/reference/android/app/appsearch/util/DocumentIdUtil#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/app/appsearch/util/DocumentIdUtil#inhmethods)  

# DocumentIdUtil

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/app/appsearch/util/DocumentIdUtil "View this page in Kotlin")\|Java

`
public


class
DocumentIdUtil
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

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

<br />

*** ** * ** ***

A util class with methods for working with document ids.

## Summary

|                                                                                                                                                                                                                                                                                                                                                            ### Public methods                                                                                                                                                                                                                                                                                                                                                             ||
|------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[String](https://developer.android.com/reference/java/lang/String) | ` `[createQualifiedId](https://developer.android.com/reference/android/app/appsearch/util/DocumentIdUtil#createQualifiedId(java.lang.String,%20java.lang.String,%20android.app.appsearch.GenericDocument))`(`[String](https://developer.android.com/reference/java/lang/String)` packageName, `[String](https://developer.android.com/reference/java/lang/String)` databaseName, `[GenericDocument](https://developer.android.com/reference/android/app/appsearch/GenericDocument)` document) ` Generates a qualified id based on package, database, and a[GenericDocument](https://developer.android.com/reference/android/app/appsearch/GenericDocument). |
| ` static `[String](https://developer.android.com/reference/java/lang/String) | ` `[createQualifiedId](https://developer.android.com/reference/android/app/appsearch/util/DocumentIdUtil#createQualifiedId(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` packageName, `[String](https://developer.android.com/reference/java/lang/String)` databaseName, `[String](https://developer.android.com/reference/java/lang/String)` namespace, `[String](https://developer.android.com/reference/java/lang/String)` id) ` Generates a qualified id based on package, database, namespace, and doc id.                                      |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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*.                                                                                             | ||

## Public methods

### createQualifiedId

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

```
public static String createQualifiedId (String packageName, 
                String databaseName, 
                GenericDocument document)
```

Generates a qualified id based on package, database, and a[GenericDocument](https://developer.android.com/reference/android/app/appsearch/GenericDocument).

<br />

|                                                     Parameters                                                     ||
|----------------|----------------------------------------------------------------------------------------------------|
| `packageName`  | `String`: The package the document belongs to. This value cannot be`null`. <br />                  |
| `databaseName` | `String`: The database containing the document. This value cannot be`null`. <br />                 |
| `document`     | `GenericDocument`: The document to generate a qualified id for. This value cannot be`null`. <br /> |

|                                                                Returns                                                                 ||
|--------------------------------------------------------------------|--------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | the qualified id of a document. This value cannot be`null`. <br /> |

**See also:**

- [createQualifiedId(String, String, String, String)](https://developer.android.com/reference/android/app/appsearch/util/DocumentIdUtil#createQualifiedId(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String))  

### createQualifiedId

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

```
public static String createQualifiedId (String packageName, 
                String databaseName, 
                String namespace, 
                String id)
```

Generates a qualified id based on package, database, namespace, and doc id.

A qualified id is a String referring to the combined package name, database name, namespace, and id of the document. It is useful for linking one document to another in order to perform a join operation with[JoinSpec](https://developer.android.com/reference/android/app/appsearch/JoinSpec).

<br />

|                                             Parameters                                             ||
|----------------|------------------------------------------------------------------------------------|
| `packageName`  | `String`: The package the document belongs to. This value cannot be`null`. <br />  |
| `databaseName` | `String`: The database containing the document. This value cannot be`null`. <br /> |
| `namespace`    | `String`: The namespace of the document. This value cannot be`null`. <br />        |
| `id`           | `String`: The id of the document. This value cannot be`null`. <br />               |

|                                                                Returns                                                                ||
|--------------------------------------------------------------------|-------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | the qualified id of a document This value cannot be`null`. <br /> |

**See also:**

- [JoinSpec](https://developer.android.com/reference/android/app/appsearch/JoinSpec)
- [ERROR(/android.app.appsearch.JoinSpec#QUALIFIED_ID)](https://developer.android.com/)