DocumentIdUtil
Stay organized with collections
Save and categorize content based on your preferences.
A util class with methods for working with document ids.
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Public Methods
public static String createQualifiedId (String packageName, String databaseName, GenericDocument
document)
Generates a qualified id based on package, database, and a GenericDocument
.
Parameters
packageName |
The package the document belongs to. |
databaseName |
The database containing the document. |
document |
The document to generate a qualified id for. |
Returns
- the qualified id of a document.
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.
Parameters
packageName |
The package the document belongs to. |
databaseName |
The database containing the document. |
namespace |
The namespace of the document. |
id |
The id of the document. |
Returns
- the qualified id of a document
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eDocumentIdUtil\u003c/code\u003e is a utility class providing methods for working with document IDs in AppSearch.\u003c/p\u003e\n"],["\u003cp\u003eIt offers two \u003ccode\u003ecreateQualifiedId\u003c/code\u003e methods to generate unique, qualified IDs for documents.\u003c/p\u003e\n"],["\u003cp\u003eQualified IDs combine package, database, namespace, and document ID for referencing and linking documents.\u003c/p\u003e\n"],["\u003cp\u003eThese IDs are crucial for operations like joining documents within AppSearch.\u003c/p\u003e\n"]]],[],null,["# DocumentIdUtil\n\npublic class **DocumentIdUtil** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nA util class with methods for working with document ids. \n\n### Public Method Summary\n\n|--------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [String](//developer.android.com/reference/java/lang/String.html) | [createQualifiedId](/android/reference/com/google/android/gms/appsearch/util/DocumentIdUtil#createQualifiedId(java.lang.String,%20java.lang.String,%20com.google.android.gms.appsearch.GenericDocument))([String](//developer.android.com/reference/java/lang/String.html) packageName, [String](//developer.android.com/reference/java/lang/String.html) databaseName, [GenericDocument](/android/reference/com/google/android/gms/appsearch/GenericDocument) document) Generates a qualified id based on package, database, and a [GenericDocument](/android/reference/com/google/android/gms/appsearch/GenericDocument). |\n| static [String](//developer.android.com/reference/java/lang/String.html) | [createQualifiedId](/android/reference/com/google/android/gms/appsearch/util/DocumentIdUtil#createQualifiedId(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String))([String](//developer.android.com/reference/java/lang/String.html) packageName, [String](//developer.android.com/reference/java/lang/String.html) databaseName, [String](//developer.android.com/reference/java/lang/String.html) namespace, [String](//developer.android.com/reference/java/lang/String.html) id) Generates a qualified id based on package, database, namespace, and doc id. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods\n--------------\n\n#### public static [String](//developer.android.com/reference/java/lang/String.html) **createQualifiedId** ([String](//developer.android.com/reference/java/lang/String.html) packageName, [String](//developer.android.com/reference/java/lang/String.html) databaseName, [GenericDocument](/android/reference/com/google/android/gms/appsearch/GenericDocument) document)\n\nGenerates a qualified id based on package, database, and a [GenericDocument](/android/reference/com/google/android/gms/appsearch/GenericDocument). \n\n##### Parameters\n\n| packageName | The package the document belongs to. |\n| databaseName | The database containing the document. |\n| document | The document to generate a qualified id for. |\n|--------------|----------------------------------------------|\n\n##### Returns\n\n- the qualified id of a document. \n\n##### See Also\n\n- [createQualifiedId(String, String, String, String)](/android/reference/com/google/android/gms/appsearch/util/DocumentIdUtil#createQualifiedId(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String)) \n\n#### public static [String](//developer.android.com/reference/java/lang/String.html) **createQualifiedId** ([String](//developer.android.com/reference/java/lang/String.html) packageName, [String](//developer.android.com/reference/java/lang/String.html) databaseName, [String](//developer.android.com/reference/java/lang/String.html) namespace, [String](//developer.android.com/reference/java/lang/String.html) id)\n\nGenerates a qualified id based on package, database, namespace, and doc id.\n\nA qualified id is a String referring to the combined package name, database name,\nnamespace, and id of the document. It is useful for linking one document to another in\norder to perform a join operation. \n\n##### Parameters\n\n| packageName | The package the document belongs to. |\n| databaseName | The database containing the document. |\n| namespace | The namespace of the document. |\n| id | The id of the document. |\n|--------------|---------------------------------------|\n\n##### Returns\n\n- the qualified id of a document"]]