Added in API level 34

DocumentIdUtil


open class DocumentIdUtil
kotlin.Any
   ↳ android.app.appsearch.util.DocumentIdUtil

A util class with methods for working with document ids.

Summary

Public methods
open static String
createQualifiedId(packageName: String, databaseName: String, document: GenericDocument)

Generates a qualified id based on package, database, and a GenericDocument.

open static String
createQualifiedId(packageName: String, databaseName: String, namespace: String, id: String)

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

Public methods

createQualifiedId

Added in API level 34
open static fun createQualifiedId(
    packageName: String,
    databaseName: String,
    document: GenericDocument
): String

Generates a qualified id based on package, database, and a GenericDocument.

Parameters
packageName String: The package the document belongs to. This value cannot be null.
databaseName String: The database containing the document. This value cannot be null.
document GenericDocument: The document to generate a qualified id for. This value cannot be null.
Return
String the qualified id of a document. This value cannot be null.

createQualifiedId

Added in API level 34
open static fun createQualifiedId(
    packageName: String,
    databaseName: String,
    namespace: String,
    id: String
): String

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.

Parameters
packageName String: The package the document belongs to. This value cannot be null.
databaseName String: The database containing the document. This value cannot be null.
namespace String: The namespace of the document. This value cannot be null.
id String: The id of the document. This value cannot be null.
Return
String the qualified id of a document This value cannot be null.