# TextLanguage.Request.Builder

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Builder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/view/textclassifier/TextLanguage.Request.Builder "View this page in Java")  

```
class Builder
```

|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                       ||
| ↳ | [android.view.textclassifier.TextLanguage.Request.Builder](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextLanguage.Request.Builder#) |

A builder for building TextLanguage requests.

## Summary

|                                                                                                                                               Public constructors                                                                                                                                               ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextLanguage.Request.Builder#Builder(kotlin.CharSequence))`(`text:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)`)` Creates a builder to build TextLanguage requests. |

|                                                                                                                                                                                                                              Public methods                                                                                                                                                                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [TextLanguage.Request](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextLanguage.Request)                  | [build](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextLanguage.Request.Builder#build())`()` Builds and returns a new TextLanguage request object.                                                                                                                                             |
| [TextLanguage.Request.Builder](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextLanguage.Request.Builder#) | [setExtras](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextLanguage.Request.Builder#setExtras(android.os.Bundle))`(`bundle:` `[Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#)`)` Sets a bundle containing non-structured extra information about the request. |

## Public constructors

### Builder

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
Builder(text: CharSequence)
```

Creates a builder to build TextLanguage requests.

|                                                                       Parameters                                                                       ||
|--------|------------------------------------------------------------------------------------------------------------------------------------------------|
| `text` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html):the text to process. This value cannot be`null`. |

## Public methods

### build

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun build(): TextLanguage.Request
```

Builds and returns a new TextLanguage request object.

If necessary, this method will verify fields, clamp them, and make them immutable.

|                                                                        Return                                                                        ||
|-------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [TextLanguage.Request](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextLanguage.Request) | This value cannot be`null`. |

### setExtras

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun setExtras(bundle: Bundle): TextLanguage.Request.Builder
```

Sets a bundle containing non-structured extra information about the request.

|                                                       Parameters                                                       ||
|----------|--------------------------------------------------------------------------------------------------------------|
| `bundle` | [Bundle](https://developer.android.com/reference/kotlin/android/os/Bundle.html#):This value cannot be`null`. |

|                                                                                Return                                                                                 ||
|------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|
| [TextLanguage.Request.Builder](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextLanguage.Request.Builder#) | This value cannot be`null`. |