AppSearchBlobHandle


@ExperimentalAppSearchApi
class AppSearchBlobHandle


An identifier to represent a blob in AppSearch.

A "blob" is a large binary object. It is used to store a significant amount of data that is not searchable, such as images, videos, audio files, or other binary data. Unlike other fields in AppSearch, blobs are stored as blob files on disk rather than in memory, and use android.os.ParcelFileDescriptor to read and write. This allows for efficient handling of large, non-searchable content.

AppSearchBlobHandle is a light-weight Property of GenericDocument, which is a pointer to the heavy-weight blob data.

The blob data could be written via openBlobForWriteAsync and read via openBlobForReadAsync.

A GenericDocument with AppSearchBlobHandleProperty could be put and read without the large blob data. This offers lazy retrieval to blob data when searching GenericDocument in AppSearch.

Summary

Public functions

java-static AppSearchBlobHandle
createWithSha256(
    digest: ByteArray,
    packageName: String,
    databaseName: String,
    namespace: String
)

Create a new AppSearch blob identifier with given digest, package, database and namespace.

Boolean
equals(o: Any!)
String

Returns the name of database stored the blob that this object is representing.

String

Returns the app-defined namespace this blob resides in.

String

Returns the package name indicating the owner app of the blob that this object is representing.

ByteArray<Byte>

Returns the SHA-256 hash of the blob that this object is representing.

Int
String

Public functions

createWithSha256

Added in 1.1.0-alpha07
java-static fun createWithSha256(
    digest: ByteArray,
    packageName: String,
    databaseName: String,
    namespace: String
): AppSearchBlobHandle

Create a new AppSearch blob identifier with given digest, package, database and namespace.

The package name and database name indicated where this blob will be stored. To write, commit or read this blob via AppSearchSession, it must match the package name and database name of AppSearchSession.

For two objects of AppSearchBlobHandle to be considered equal, the packageName, database, namespace and digest must be equal.

Parameters
digest: ByteArray

The SHA-256 hash of the blob this is representing.

packageName: String

The package name of the owner of this Blob.

databaseName: String

The database name of this blob to stored into.

namespace: String

The namespace of this blob resides in.

Returns
AppSearchBlobHandle

a new instance of AppSearchBlobHandle object.

equals

fun equals(o: Any!): Boolean

getDatabaseName

Added in 1.1.0-alpha07
fun getDatabaseName(): String

Returns the name of database stored the blob that this object is representing.

For two objects of AppSearchBlobHandle to be considered equal, the packageName, database, namespace and digest must be equal.

getNamespace

Added in 1.1.0-alpha07
fun getNamespace(): String

Returns the app-defined namespace this blob resides in.

For two objects of AppSearchBlobHandle to be considered equal, the packageName, database, namespace and digest must be equal.

getPackageName

Added in 1.1.0-alpha07
fun getPackageName(): String

Returns the package name indicating the owner app of the blob that this object is representing.

For two objects of AppSearchBlobHandle to be considered equal, the packageName, database, namespace and digest must be equal.

getSha256Digest

Added in 1.1.0-alpha07
fun getSha256Digest(): ByteArray<Byte>

Returns the SHA-256 hash of the blob that this object is representing.

For two objects of AppSearchBlobHandle to be considered equal, the packageName, database, namespace and digest must be equal.

hashCode

fun hashCode(): Int

toString

fun toString(): String