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 by using the GenericDocument.Builder
.
clone()
boolean voidfinalize()
final Class<?>getClass()
inthashCode()
final voidnotify()
final voidnotifyAll()
StringtoString()
final voidwait(long arg0, int arg1)
final voidwait(long arg0)
final voidwait()
Protected Constructors protected GenericDocument (GenericDocument document)Creates a new GenericDocument
from an existing instance.
This method should be only used by constructor of a subclass.
Public Methods public boolean equals (Object other) public long getCreationTimestampMillis () public static int getMaxIndexedProperties () public Object getProperty (String path)Retrieves the property value with the given path as Object
.
A path can be a simple property name, such as those returned by getPropertyNames()
. It may also be a dot-delimited path through the nested document hierarchy, with nested GenericDocument
properties accessed via '.'
and repeated properties optionally indexed into via [n]
.
For example, given the following GenericDocument
:
(Message) { from: "sender@example.com" to: [{ name: "Albert Einstein" email: "einstein@example.com" }, { name: "Marie Curie" email: "curie@example.com" }] tags: ["important", "inbox"] subject: "Hello" }
Here are some example paths and their results:
"from"
returns "sender@example.com"
as a String
array with one element"to"
returns the two nested documents containing contact information as a GenericDocument
array with two elements"to[1]"
returns the second nested document containing Marie Curie's contact information as a GenericDocument
array with one element"to[1].email"
returns "curie@example.com"
"to[100].email"
returns null
as this particular document does not have that many elements in its "to"
array."to.email"
aggregates emails across all nested documents that have them, returning ["einstein@example.com", "curie@example.com"]
as a String
array with two elements.If you know the expected type of the property you are retrieving, it is recommended to use one of the typed versions of this method instead, such as getPropertyString(String)
or getPropertyStringArray(String)
.
If the property was assigned as an empty array using one of the Builder#setProperty
functions, this method will return an empty array. If no such property exists at all, this method returns null
.
Note: If the property is an empty GenericDocument
[] or byte[][]
, this method will return a null
value in versions of Android prior to Android T
. Starting in Android T it will return an empty array if the property has been set as an empty array, matching the behavior of other property types.
null
if there is no such path. The returned object will be one of the following types: String[]
, long[]
, double[]
, boolean[]
, byte[][]
, GenericDocument[]
.Retrieves a boolean
property by path.
See getProperty(String)
for a detailed description of the path syntax.
boolean
associated with the given path or default value false
if there is no such value or the value is of a different type.boolean[]
associated with the given path, or null
if no value is set or the value is of a different type.Retrieves a byte[]
property by path.
See getProperty(String)
for a detailed description of the path syntax.
byte[]
associated with the given path or null
if there is no such value or the value is of a different type.byte[][]
associated with the given path, or null
if no value is set or the value is of a different type.GenericDocument
associated with the given path or null
if there is no such value or the value is of a different type.GenericDocument
[] associated with the given path, or null
if no value is set or the value is of a different type.Retrieves a double
property by path.
See getProperty(String)
for a detailed description of the path syntax.
double
associated with the given path or default value 0.0
if there is no such value or the value is of a different type.double[]
associated with the given path, or null
if no value is set or the value is of a different type.Retrieves a long
property by path.
See getProperty(String)
for a detailed description of the path syntax.
long
associated with the given path or default value 0
if there is no such value or the value is of a different type.long[]
associated with the given path, or null
if no value is set or the value is of a different type.Returns the names of all properties defined in this document.
public String getPropertyString (String path) Parameters path The path to look for. ReturnsString
associated with the given path or null
if there is no such value or the value is of a different type.String[]
associated with the given path, or null
if no value is set or the value is of a different type.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4