DocumentIdUtil


public class DocumentIdUtil


A util class with methods for working with document ids.

Summary

Public methods

static @NonNull String
createQualifiedId(
    @NonNull String packageName,
    @NonNull String databaseName,
    @NonNull GenericDocument document
)

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

static @NonNull String
createQualifiedId(
    @NonNull String packageName,
    @NonNull String databaseName,
    @NonNull String namespace,
    @NonNull String id
)

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

Public methods

createQualifiedId

Added in 1.1.0-alpha06
public static @NonNull String createQualifiedId(
    @NonNull String packageName,
    @NonNull String databaseName,
    @NonNull GenericDocument document
)

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

Parameters
@NonNull String packageName

The package the document belongs to.

@NonNull String databaseName

The database containing the document.

@NonNull GenericDocument document

The document to generate a qualified id for.

Returns
@NonNull String

the qualified id of a document.

createQualifiedId

Added in 1.1.0-alpha06
public static @NonNull String createQualifiedId(
    @NonNull String packageName,
    @NonNull String databaseName,
    @NonNull String namespace,
    @NonNull 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
@NonNull String packageName

The package the document belongs to.

@NonNull String databaseName

The database containing the document.

@NonNull String namespace

The namespace of the document.

@NonNull String id

The id of the document.

Returns
@NonNull String

the qualified id of a document