Boolean |
equals(other: Any?)
Indicates whether some other object is "equal to" this one.
The equals method implements an equivalence relation on non-null object references:
- It is reflexive: for any non-null reference value
x, x.equals(x) should return true.
- It is symmetric: for any non-null reference values
x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
- It is transitive: for any non-null reference values
x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
- It is consistent: for any non-null reference values
x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
- For any non-null reference value
x, x.equals(null) should return false.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
|
Long |
getCreationTimestampMillis()
Returns the creation timestamp of the GenericDocument, in milliseconds.
The value is in the System.currentTimeMillis time base. Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.
|
String |
getId()
Returns the unique identifier of the GenericDocument.
|
Int |
getMaxIndexedProperties()
The maximum number of indexed properties a document can have.
Indexed properties are properties which are strings where the AppSearchSchema.StringPropertyConfig.getIndexingType value is anything other than AppSearchSchema.StringPropertyConfig.INDEXING_TYPE_NONE, as well as long properties where the AppSearchSchema.LongPropertyConfig.getIndexingType value is AppSearchSchema.LongPropertyConfig.INDEXING_TYPE_RANGE.
|
String |
getNamespace()
Returns the namespace of the GenericDocument.
|
Any? |
getProperty(path: String)
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 or getPropertyStringArray.
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.
|
AppSearchBlobHandle? |
getPropertyBlobHandle(path: String)
Retrieves an AppSearchBlobHandle property by path.
See getProperty for a detailed description of the path syntax.
See AppSearchSession.openBlobForRead for how to use AppSearchBlobHandle to retrieve blob data.
|
Array<AppSearchBlobHandle!>? |
getPropertyBlobHandleArray(path: String)
Retrieves a repeated AppSearchBlobHandle[] property by path.
See getProperty for a detailed description of the path syntax.
If the property has not been set via Builder.setPropertyBlobHandle, this method returns null.
If it has been set via Builder.setPropertyBlobHandle to an empty AppSearchBlobHandle[], this method returns an empty AppSearchBlobHandle[].
|
Boolean |
getPropertyBoolean(path: String)
Retrieves a boolean property by path.
See getProperty for a detailed description of the path syntax.
|
BooleanArray? |
getPropertyBooleanArray(path: String)
Retrieves a repeated boolean property by path.
See getProperty for a detailed description of the path syntax.
If the property has not been set via Builder.setPropertyBoolean, this method returns null.
If it has been set via Builder.setPropertyBoolean to an empty boolean[], this method returns an empty boolean[].
|
ByteArray? |
getPropertyBytes(path: String)
Retrieves a byte[] property by path.
See getProperty for a detailed description of the path syntax.
|
Array<ByteArray!>? |
getPropertyBytesArray(path: String)
Retrieves a byte[][] property by path.
See getProperty for a detailed description of the path syntax.
If the property has not been set via Builder.setPropertyBytes, this method returns null.
If it has been set via Builder.setPropertyBytes to an empty byte[][], this method returns an empty byte[][] starting in Android T and null in earlier versions of Android.
|
GenericDocument? |
getPropertyDocument(path: String)
Retrieves a GenericDocument property by path.
See getProperty for a detailed description of the path syntax.
|
Array<GenericDocument!>? |
getPropertyDocumentArray(path: String)
Retrieves a repeated GenericDocument property by path.
See getProperty for a detailed description of the path syntax.
If the property has not been set via Builder.setPropertyDocument, this method returns null.
If it has been set via Builder.setPropertyDocument to an empty GenericDocument[], this method returns an empty GenericDocument[] starting in Android T and null in earlier versions of Android.
|
Double |
getPropertyDouble(path: String)
Retrieves a double property by path.
See getProperty for a detailed description of the path syntax.
|
DoubleArray? |
getPropertyDoubleArray(path: String)
Retrieves a repeated double property by path.
See getProperty for a detailed description of the path syntax.
If the property has not been set via Builder.setPropertyDouble, this method returns null.
If it has been set via Builder.setPropertyDouble to an empty double[], this method returns an empty double[].
|
EmbeddingVector? |
getPropertyEmbedding(path: String)
Retrieves an EmbeddingVector property by path.
See getProperty for a detailed description of the path syntax.
|
Array<EmbeddingVector!>? |
getPropertyEmbeddingArray(path: String)
Retrieves a repeated EmbeddingVector[] property by path.
See getProperty for a detailed description of the path syntax.
If the property has not been set via Builder.setPropertyEmbedding, this method returns null.
If it has been set via Builder.setPropertyEmbedding to an empty EmbeddingVector[], this method returns an empty EmbeddingVector[].
|
Long |
getPropertyLong(path: String)
Retrieves a long property by path.
See getProperty for a detailed description of the path syntax.
|
LongArray? |
getPropertyLongArray(path: String)
Retrieves a repeated long[] property by path.
See getProperty for a detailed description of the path syntax.
If the property has not been set via Builder.setPropertyLong, this method returns null.
If it has been set via Builder.setPropertyLong to an empty long[], this method returns an empty long[].
|
MutableSet<String!> |
getPropertyNames()
Returns the names of all properties defined in this document.
|
String? |
getPropertyString(path: String)
Retrieves a String property by path.
See getProperty for a detailed description of the path syntax.
|
Array<String!>? |
getPropertyStringArray(path: String)
Retrieves a repeated String property by path.
See getProperty for a detailed description of the path syntax.
If the property has not been set via Builder.setPropertyString, this method returns null.
If it has been set via Builder.setPropertyString to an empty String[], this method returns an empty String[].
|
String |
getSchemaType()
Returns the AppSearchSchema type of the GenericDocument.
|
Int |
getScore()
Returns the score of the GenericDocument.
The score is a query-independent measure of the document's quality, relative to other GenericDocument objects of the same AppSearchSchema type.
Results may be sorted by score using android.app.appsearch.SearchSpec.Builder#setRankingStrategy. Documents with higher scores are considered better than documents with lower scores.
Any non-negative integer can be used a score.
|
Long |
getTtlMillis()
Returns the TTL (time-to-live) of the GenericDocument, in milliseconds.
The TTL is measured against getCreationTimestampMillis. At the timestamp of creationTimestampMillis + ttlMillis, measured in the System.currentTimeMillis time base, the document will be auto-deleted.
The default value is 0, which means the document is permanent and won't be auto-deleted until the app is uninstalled or android.app.appsearch.AppSearchSession#remove is called.
|
Int |
hashCode()
Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.
The general contract of hashCode is:
- Whenever it is invoked on the same object more than once during an execution of a Java application, the
hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the
equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
- It is not required that if two objects are unequal according to the
equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
|
String |
toString()
Returns a string representation of the object.
|