# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# TranslationResponse.Builder

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

java.lang.Object
↳ | android.view.translation.TranslationResponse.Builder

A builder for `TranslationResponse`

## Summary

### Public constructors
`Builder(int translationStatus)` Creates a new Builder.

### Public methods
`TranslationResponse` | `build()` Builds the instance.
`TranslationResponse.Builder` | `setFinalResponse(boolean value)` Whether this response contains complete translated values, or is the final response in a series of partial responses.
`TranslationResponse.Builder` | `setTranslationResponseValue(int index, TranslationResponseValue value)` Adds `TranslationResponseValue` to be translated.
`TranslationResponse.Builder` | `setTranslationResponseValues(SparseArray<TranslationResponseValue> value)` List of translated `TranslationResponseValue`s.
`TranslationResponse.Builder` | `setViewTranslationResponse(int index, ViewTranslationResponse response)` Sets the list of `ViewTranslationResponse` to be translated.
`TranslationResponse.Builder` | `setViewTranslationResponses(SparseArray<ViewTranslationResponse> value)` List of translated `ViewTranslationResponse`s.

### 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 (int translationStatus)

Creates a new Builder.

Parameters
`translationStatus` | `int`: The translation result status code. Value is `TranslationResponse.TRANSLATION_STATUS_SUCCESS`, `TranslationResponse.TRANSLATION_STATUS_UNKNOWN_ERROR`, or `TranslationResponse.TRANSLATION_STATUS_CONTEXT_UNSUPPORTED`

## Public methods

### build

    public TranslationResponse build ()

Builds the instance. This builder should not be touched after calling this!

Returns
`TranslationResponse` | This value cannot be `null`.

### setFinalResponse

    public TranslationResponse.Builder setFinalResponse (boolean value)

Whether this response contains complete translated values, or is the final response in a series of partial responses.

This is `true` by default.

Parameters
`value` | `boolean`

Returns
`TranslationResponse.Builder` | This value cannot be `null`.

### setTranslationResponseValue

    public TranslationResponse.Builder setTranslationResponseValue (int index,
                    TranslationResponseValue value)

Adds `TranslationResponseValue` to be translated. The input TranslationResponseValue format should match those provided by the `Translator`'s targetSpec.

Parameters
`index` | `int`
`value` | `TranslationResponseValue`: the translated value. This value cannot be `null`.

Returns
`TranslationResponse.Builder` | this Builder. This value cannot be `null`.

### setTranslationResponseValues

    public TranslationResponse.Builder setTranslationResponseValues (SparseArray<TranslationResponseValue> value)

List of translated `TranslationResponseValue`s. The key of entries in this list will be their respective index in `TranslationRequest#getTranslationRequestValues()`.

Parameters
`value` | `SparseArray`: This value cannot be `null`.

Returns
`TranslationResponse.Builder` | This value cannot be `null`.

### setViewTranslationResponse

    public TranslationResponse.Builder setViewTranslationResponse (int index,
                    ViewTranslationResponse response)

Sets the list of `ViewTranslationResponse` to be translated. The input ViewTranslationResponse contains `TranslationResponseValue`s whose format should match those provided by the `Translator`'s targetSpec.

Parameters
`index` | `int`
`response` | `ViewTranslationResponse`: the translated response. This value cannot be `null`.

Returns
`TranslationResponse.Builder` | this Builder. This value cannot be `null`.

### setViewTranslationResponses

    public TranslationResponse.Builder setViewTranslationResponses (SparseArray<ViewTranslationResponse> value)

List of translated `ViewTranslationResponse`s. The key of entries in this list will be their respective index in `TranslationRequest#getViewTranslationRequests()`.

Parameters
`value` | `SparseArray`: This value cannot be `null`.

Returns
`TranslationResponse.Builder` | 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
*
*