Stay organized with collections
Save and categorize content based on your preferences.
AppSearchBatchResult
class AppSearchBatchResult<KeyType : Any!, ValueType : Any!>
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
Public methods
toString
fun toString(): String
Returns a string representation of the object.
Return |
String |
This value cannot be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# AppSearchBatchResult\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nAppSearchBatchResult\n====================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/app/appsearch/AppSearchBatchResult \"View this page in Java\") \n\n```\nclass AppSearchBatchResult\u003cKeyType : Any!, ValueType : Any!\u003e\n```\n\n|---|-------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.app.appsearch.AppSearchBatchResult](#) |\n\nProvides results for AppSearch batch operations which encompass multiple documents.\n\nIndividual results of a batch operation are separated into two maps: one for successes and one for failures. For successes, [getSuccesses()](#getSuccesses()) will return a map of keys to instances of the value type. For failures, [getFailures()](#getFailures()) will return a map of keys to [AppSearchResult](/reference/kotlin/android/app/appsearch/AppSearchResult) objects.\n\nAlternatively, [getAll()](#getAll()) returns a map of keys to [AppSearchResult](/reference/kotlin/android/app/appsearch/AppSearchResult) objects for both successes and failures.\n\nSummary\n-------\n\n| Nested classes ||\n|---|--------------------------------------------------------------------------------------------------------------------------------|\n| | [Builder](/reference/kotlin/android/app/appsearch/AppSearchBatchResult.Builder) Builder for [AppSearchBatchResult](#) objects. |\n\n| Public methods ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [MutableMap](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)\\\u003cKeyType, [AppSearchResult](/reference/kotlin/android/app/appsearch/AppSearchResult)\\\u003cValueType\\\u003e!\\\u003e | [getAll](#getAll())`()` Returns a [Map](../../../java/util/Map.html#) of keys mapped to instances of [AppSearchResult](/reference/kotlin/android/app/appsearch/AppSearchResult) for all individual results. |\n| [MutableMap](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)\\\u003cKeyType, [AppSearchResult](/reference/kotlin/android/app/appsearch/AppSearchResult)\\\u003cValueType\\\u003e!\\\u003e | [getFailures](#getFailures())`()` Returns a [Map](../../../java/util/Map.html#) of keys mapped to instances of [AppSearchResult](/reference/kotlin/android/app/appsearch/AppSearchResult) for all failed individual results. |\n| [MutableMap](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html)\\\u003cKeyType, ValueType\\\u003e | [getSuccesses](#getSuccesses())`()` Returns a [Map](../../../java/util/Map.html#) of keys mapped to instances of the value type for all successful individual results. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isSuccess](#isSuccess())`()` Returns `true` if this [AppSearchBatchResult](#) has no failures. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` Returns a string representation of the object. |\n\nPublic methods\n--------------\n\n### getAll\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getAll(): MutableMap\u003cKeyType, AppSearchResult\u003cValueType\u003e!\u003e\n```\n\nReturns a [Map](../../../java/util/Map.html#) of keys mapped to instances of [AppSearchResult](/reference/kotlin/android/app/appsearch/AppSearchResult) for all individual results.\n\nThe values of the [Map](../../../java/util/Map.html#) will not be `null`. \n\n### getFailures\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getFailures(): MutableMap\u003cKeyType, AppSearchResult\u003cValueType\u003e!\u003e\n```\n\nReturns a [Map](../../../java/util/Map.html#) of keys mapped to instances of [AppSearchResult](/reference/kotlin/android/app/appsearch/AppSearchResult) for all failed individual results.\n\nThe values of the [Map](../../../java/util/Map.html#) will not be `null`. \n\n### getSuccesses\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getSuccesses(): MutableMap\u003cKeyType, ValueType\u003e\n```\n\nReturns a [Map](../../../java/util/Map.html#) of keys mapped to instances of the value type for all successful individual results.\n\nExample: [AppSearchSession.getByDocumentId](/reference/kotlin/android/app/appsearch/AppSearchSession#getByDocumentId(android.app.appsearch.GetByDocumentIdRequest,%20java.util.concurrent.Executor,%20android.app.appsearch.BatchResultCallback)) returns an [AppSearchBatchResult](#). Each key (the document ID, of `String` type) will map to a [GenericDocument](/reference/kotlin/android/app/appsearch/GenericDocument) object.\n\nThe values of the [Map](../../../java/util/Map.html#) will not be `null`. \n\n### isSuccess\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun isSuccess(): Boolean\n```\n\nReturns `true` if this [AppSearchBatchResult](#) has no failures. \n\n### toString\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun toString(): String\n```\n\nReturns a string representation of the object.\n\n| Return ||\n|----------------------------------------------------------------------------------|------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | This value cannot be `null`. |"]]