summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Alexander Dorokhine <adorokhine@google.com> 2020-11-22 01:20:58 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-11-22 01:20:58 +0000
commitca4b13a6fe231b41385e95dda80ff2d8ede8b0f9 (patch)
treedb19f43aecbf04bb9c7c87d17ac77bf9c1ade85d
parent851e4dadaa4e9e1d6318fc5f395433240a889714 (diff)
parentf13a62ae2e8e400615955716ded0ad310321bbb4 (diff)
Merge "Unhide GenericDocument API."
-rw-r--r--apex/appsearch/framework/api/current.txt40
-rw-r--r--apex/appsearch/framework/java/android/app/appsearch/GenericDocument.java13
2 files changed, 46 insertions, 7 deletions
diff --git a/apex/appsearch/framework/api/current.txt b/apex/appsearch/framework/api/current.txt
index 3c4706261d03..fdf891b14c9e 100644
--- a/apex/appsearch/framework/api/current.txt
+++ b/apex/appsearch/framework/api/current.txt
@@ -45,5 +45,45 @@ package android.app.appsearch {
method @NonNull public android.app.appsearch.AppSearchSchema.PropertyConfig.Builder setTokenizerType(int);
}
+ public class GenericDocument {
+ ctor protected GenericDocument(@NonNull android.app.appsearch.GenericDocument);
+ method public long getCreationTimestampMillis();
+ method public static int getMaxIndexedProperties();
+ method @NonNull public String getNamespace();
+ method public boolean getPropertyBoolean(@NonNull String);
+ method @Nullable public boolean[] getPropertyBooleanArray(@NonNull String);
+ method @Nullable public byte[] getPropertyBytes(@NonNull String);
+ method @Nullable public byte[][] getPropertyBytesArray(@NonNull String);
+ method @Nullable public android.app.appsearch.GenericDocument getPropertyDocument(@NonNull String);
+ method @Nullable public android.app.appsearch.GenericDocument[] getPropertyDocumentArray(@NonNull String);
+ method public double getPropertyDouble(@NonNull String);
+ method @Nullable public double[] getPropertyDoubleArray(@NonNull String);
+ method public long getPropertyLong(@NonNull String);
+ method @Nullable public long[] getPropertyLongArray(@NonNull String);
+ method @NonNull public java.util.Set<java.lang.String> getPropertyNames();
+ method @Nullable public String getPropertyString(@NonNull String);
+ method @Nullable public String[] getPropertyStringArray(@NonNull String);
+ method @NonNull public String getSchemaType();
+ method public int getScore();
+ method public long getTtlMillis();
+ method @NonNull public String getUri();
+ field public static final String DEFAULT_NAMESPACE = "";
+ }
+
+ public static class GenericDocument.Builder<BuilderType extends android.app.appsearch.GenericDocument.Builder> {
+ ctor public GenericDocument.Builder(@NonNull String, @NonNull String);
+ method @NonNull public android.app.appsearch.GenericDocument build();
+ method @NonNull public BuilderType setCreationTimestampMillis(long);
+ method @NonNull public BuilderType setNamespace(@NonNull String);
+ method @NonNull public BuilderType setPropertyBoolean(@NonNull String, @NonNull boolean...);
+ method @NonNull public BuilderType setPropertyBytes(@NonNull String, @NonNull byte[]...);
+ method @NonNull public BuilderType setPropertyDocument(@NonNull String, @NonNull android.app.appsearch.GenericDocument...);
+ method @NonNull public BuilderType setPropertyDouble(@NonNull String, @NonNull double...);
+ method @NonNull public BuilderType setPropertyLong(@NonNull String, @NonNull long...);
+ method @NonNull public BuilderType setPropertyString(@NonNull String, @NonNull java.lang.String...);
+ method @NonNull public BuilderType setScore(@IntRange(from=0, to=java.lang.Integer.MAX_VALUE) int);
+ method @NonNull public BuilderType setTtlMillis(long);
+ }
+
}
diff --git a/apex/appsearch/framework/java/android/app/appsearch/GenericDocument.java b/apex/appsearch/framework/java/android/app/appsearch/GenericDocument.java
index f41fa8df453a..0056377f007a 100644
--- a/apex/appsearch/framework/java/android/app/appsearch/GenericDocument.java
+++ b/apex/appsearch/framework/java/android/app/appsearch/GenericDocument.java
@@ -37,10 +37,9 @@ import java.util.Set;
*
* <p>Documents are constructed via {@link GenericDocument.Builder}.
*
- * @see AppSearchSession#putDocuments
- * @see AppSearchSession#getByUri
- * @see AppSearchSession#query
- * @hide
+ * @see AppSearchManager#putDocuments
+ * @see AppSearchManager#getByUri
+ * @see AppSearchManager#query
*/
public class GenericDocument {
private static final String TAG = "GenericDocument";
@@ -684,10 +683,10 @@ public class GenericDocument {
*
* @param uri The uri of {@link GenericDocument}.
* @param schemaType The schema type of the {@link GenericDocument}. The passed-in {@code
- * schemaType} must be defined using {@link AppSearchSession#setSchema} prior to
+ * schemaType} must be defined using {@link AppSearchManager#setSchema} prior to
* inserting a document of this {@code schemaType} into the AppSearch index using {@link
- * AppSearchSession#putDocuments}. Otherwise, the document will be rejected by {@link
- * AppSearchSession#putDocuments}.
+ * AppSearchManager#putDocuments}. Otherwise, the document will be rejected by {@link
+ * AppSearchManager#putDocuments}.
*/
@SuppressWarnings("unchecked")
public Builder(@NonNull String uri, @NonNull String schemaType) {