# Print output for @column tags ?> AppSearchBatchResult - Android SDK | Android Developers

Most visited

Recently visited

AppSearchBatchResult

public final class AppSearchBatchResult
extends Object

java.lang.Object
   ↳ android.app.appsearch.AppSearchBatchResult<KeyType, ValueType>


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.

See also:

Summary

Nested classes

class AppSearchBatchResult.Builder<KeyType, ValueType>

Builder for AppSearchBatchResult objects. 

Public methods

Map<KeyType, AppSearchResult<ValueType>> getAll()

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

Map<KeyType, AppSearchResult<ValueType>> getFailures()

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

Map<KeyType, ValueType> getSuccesses()

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

boolean isSuccess()

Returns true if this AppSearchBatchResult has no failures.

String toString()

Returns a string representation of the object.

Inherited methods

Public methods

getAll

public Map<KeyType, AppSearchResult<ValueType>> getAll ()

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

The values of the Map will not be null.

Returns
Map<KeyType, AppSearchResult<ValueType>>

getFailures

public Map<KeyType, AppSearchResult<ValueType>> getFailures ()

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

The values of the Map will not be null.

Returns
Map<KeyType, AppSearchResult<ValueType>>

getSuccesses

public Map<KeyType, ValueType> getSuccesses ()

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.

Returns
Map<KeyType, ValueType>

isSuccess

public boolean isSuccess ()

Returns true if this AppSearchBatchResult has no failures.

Returns
boolean

toString

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
String This value cannot be null.