public class GenericDocument
extends Object


Represents a document unit.

Documents contain structured data conforming to their AppSearchSchema type. Each document is uniquely identified by a namespace and a String ID within that namespace.

Documents are constructed either by using the GenericDocument.Builder or providing an annotated Document data class.


Nested classes

class GenericDocument.Builder<BuilderType extends Builder>

The builder class for GenericDocument

Protected constructors

GenericDocument(GenericDocument document)

Creates a new GenericDocument from an existing instance.

Public methods

boolean equals(Object other)
static GenericDocument fromDocumentClass(Object document)

Converts an instance of a class annotated with \@Document into an instance of GenericDocument.

long getCreationTimestampMillis()

Returns the creation timestamp of the GenericDocument, in milliseconds.

String getId()

Returns the unique identifier of the GenericDocument.

static int getMaxIndexedProperties()

The maximum number of indexed properties a document can have.

String getNamespace()

Returns the namespace of the GenericDocument.

Object getProperty(String path)

Retrieves the property value with the given path as Object.

boolean getPropertyBool