Added in API level 31

AppSearchBatchResult


class AppSearchBatchResult<KeyType : Any!, ValueType : Any!>
kotlin.Any
   ↳ android.app.appsearch.AppSearchBatchResult

Provides results for AppSearch batch operations which encompass multiple documents.

Individual results of a batch operation are separated into two maps: one for successes and one for failures. For successes, getSuccesses() will return a map of keys to instances of the value type. For failures, getFailures() will return a map of keys to AppSearchResult objects.

Alternatively, getAll() returns a map of keys to AppSearchResult objects for both successes and failures.

Summary

Nested classes

Builder for AppSearchBatchResult objects.

Public methods
MutableMap<KeyType, AppSearchResult<ValueType>!>

Returns a Map of keys mapped to instances of AppSearchResult for all individual results.

MutableMap<KeyType, AppSearchResult<ValueType>!>

Returns a Map of keys mapped to instances of AppSearchResult for all failed individual results.

MutableMap<KeyType, ValueType>

Returns a Map of keys mapped to instances of the value type for all successful individual results.

Boolean

Returns true if this AppSearchBatchResult has no failures.

String

Returns a string representation of the object.

Public methods

getAll

Added in API level 31
fun getAll(): MutableMap<KeyType, AppSearchResult<ValueType>!>

Returns a Map of keys mapped to instances of AppSearchResult for all individual results.

The values of the Map will not be null.

getFailures

Added in API level 31
fun getFailures(): MutableMap<KeyType, AppSearchResult<ValueType>!>

Returns a Map of keys mapped to instances of AppSearchResult for all failed individual results.

The values of the Map will not be null.

getSuccesses

Added in API level 31
fun getSuccesses(): MutableMap<KeyType, ValueType>

Returns a Map of keys mapped to instances of the value type for all successful individual results.

Example: AppSearchSession#getByDocumentId returns an AppSearchBatchResult. Each key (the document ID, of String type) will map to a GenericDocument object.

The values of the Map will not be null.

isSuccess

Added in API level 31
fun isSuccess(): Boolean

Returns true if this AppSearchBatchResult has no failures.

toString

Added in API level 31
fun toString(): String

Returns a string representation of the object.

Return
String This value cannot be null.