# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# AppSearchBatchResult.Builder

`public static final class AppSearchBatchResult.Builder`
`extends Object` ``

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

Builder for `AppSearchBatchResult` objects.

## Summary

### Public constructors
`Builder()`

### Public methods
`AppSearchBatchResult<KeyType, ValueType>` | `build()` Builds an `AppSearchBatchResult` object from the contents of this `Builder`.
`Builder<KeyType, ValueType>` | `setFailure(KeyType key, int resultCode, String errorMessage)` Associates the `key` with the provided failure code and error message.
`Builder<KeyType, ValueType>` | `setResult(KeyType key, AppSearchResult<ValueType> result)` Associates the `key` with the provided `result`.
`Builder<KeyType, ValueType>` | `setSuccess(KeyType key, ValueType value)` Associates the `key` with the provided successful return value.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public constructors

### Builder

    public Builder ()

## Public methods

### build

    public AppSearchBatchResult<KeyType, ValueType> build ()

Builds an `AppSearchBatchResult` object from the contents of this `Builder`.

Returns
`AppSearchBatchResult<KeyType, ValueType>` | This value cannot be `null`.

### setFailure

    public Builder<KeyType, ValueType> setFailure (KeyType key,
                    int resultCode,
                    String errorMessage)

Associates the `key` with the provided failure code and error message.

Any previous mapping for a key, whether success or failure, is deleted.

This is a convenience function which is equivalent to `setResult(key, AppSearchResult.newFailedResult(resultCode, errorMessage))`.

Parameters
`key` | `KeyType`: The key to associate the result with; usually corresponds to some identifier from the input like an ID or name. This value cannot be `null`.
`resultCode` | `int`: One of the constants documented in `AppSearchResult.getResultCode()`. Value is `AppSearchResult.RESULT_OK`, `AppSearchResult.RESULT_UNKNOWN_ERROR`, `AppSearchResult.RESULT_INTERNAL_ERROR`, `AppSearchResult.RESULT_INVALID_ARGUMENT`, `AppSearchResult.RESULT_IO_ERROR`, `AppSearchResult.RESULT_OUT_OF_SPACE`, `AppSearchResult.RESULT_NOT_FOUND`, `AppSearchResult.RESULT_INVALID_SCHEMA`, or `AppSearchResult.RESULT_SECURITY_ERROR`
`errorMessage` | `String`: An optional string describing the reason or nature of the failure. This value may be `null`.

Returns
`Builder<KeyType, ValueType>` | This value cannot be `null`.

### setResult

    public Builder<KeyType, ValueType> setResult (KeyType key,
                    AppSearchResult<ValueType> result)

Associates the `key` with the provided `result`.

Any previous mapping for a key, whether success or failure, is deleted.

Parameters
`key` | `KeyType`: The key to associate the result with; usually corresponds to some identifier from the input like an ID or name. This value cannot be `null`.
`result` | `AppSearchResult`: The result to associate with the key. This value cannot be `null`.

Returns
`Builder<KeyType, ValueType>` | This value cannot be `null`.

### setSuccess

    public Builder<KeyType, ValueType> setSuccess (KeyType key,
                    ValueType value)

Associates the `key` with the provided successful return value.

Any previous mapping for a key, whether success or failure, is deleted.

This is a convenience function which is equivalent to `setResult(key, AppSearchResult.newSuccessfulResult(value))`.

Parameters
`key` | `KeyType`: The key to associate the result with; usually corresponds to some identifier from the input like an ID or name. This value cannot be `null`.
`value` | `ValueType`: An optional value to associate with the successful result of the operation being performed. This value may be `null`.

Returns
`Builder<KeyType, ValueType>` | This value cannot be `null`.

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*