# TextClassification.Request.Builder

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Ctors](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request.Builder#pubctors)\|[Methods](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request.Builder#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request.Builder#inhmethods)  

# TextClassification.Request.Builder

*** ** * ** ***

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

`
public
static
final

class
TextClassification.Request.Builder
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|----------------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.textclassifier.TextClassification.Request.Builder |

<br />

*** ** * ** ***

A builder for building TextClassification requests.

## Summary

|                                                                                                                                    ### Public constructors                                                                                                                                    ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Builder](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request.Builder#Builder(java.lang.CharSequence,%20int,%20int))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` text, int startIndex, int endIndex) ` |

|                                                                                                                                                                                                      ### Public methods                                                                                                                                                                                                       ||
|-------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[TextClassification.Request](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request)                 | ` `[build](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request.Builder#build())`() ` Builds and returns the request object.                                                                                                       |
| ` `[TextClassification.Request.Builder](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request.Builder) | ` `[setDefaultLocales](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request.Builder#setDefaultLocales(android.os.LocaleList))`(`[LocaleList](https://developer.android.com/reference/android/os/LocaleList)` defaultLocales) `     |
| ` `[TextClassification.Request.Builder](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request.Builder) | ` `[setExtras](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request.Builder#setExtras(android.os.Bundle))`(`[Bundle](https://developer.android.com/reference/android/os/Bundle)` extras) ` Sets the extended data.                 |
| ` `[TextClassification.Request.Builder](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request.Builder) | ` `[setReferenceTime](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request.Builder#setReferenceTime(java.time.ZonedDateTime))`(`[ZonedDateTime](https://developer.android.com/reference/java/time/ZonedDateTime)` referenceTime) ` |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public constructors

### Builder

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

```
public Builder (CharSequence text, 
                int startIndex, 
                int endIndex)
```

<br />

<br />

|                                                                                               Parameters                                                                                                ||
|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `text`       | `CharSequence`: text providing context for the text to classify (which is specified by the sub sequence starting at startIndex and ending at endIndex) This value cannot be`null`. <br /> |
| `startIndex` | `int`: start index of the text to classify Value is 0 or greater <br />                                                                                                                   |
| `endIndex`   | `int`: end index of the text to classify Value is 0 or greater <br />                                                                                                                     |

## Public methods

### build

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

```
public TextClassification.Request build ()
```

Builds and returns the request object.

<br />

|                                                                             Returns                                                                              ||
|------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [TextClassification.Request](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request) | This value cannot be`null`. <br /> |

### setDefaultLocales

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

```
public TextClassification.Request.Builder setDefaultLocales (LocaleList defaultLocales)
```

<br />

<br />

|                                                                                               Parameters                                                                                                ||
|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `defaultLocales` | `LocaleList`: ordered list of locale preferences that may be used to disambiguate the provided text. If no locale preferences exist, set this to null or an empty locale list. <br /> |

|                                                                                            Returns                                                                                            ||
|----------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|
| [TextClassification.Request.Builder](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request.Builder) | this builder This value cannot be`null`. <br /> |

### setExtras

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

```
public TextClassification.Request.Builder setExtras (Bundle extras)
```

Sets the extended data.

<br />

|                     Parameters                      ||
|----------|-------------------------------------------|
| `extras` | `Bundle`: This value may be`null`. <br /> |

|                                                                                            Returns                                                                                            ||
|----------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|
| [TextClassification.Request.Builder](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request.Builder) | this builder This value cannot be`null`. <br /> |

### setReferenceTime

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

```
public TextClassification.Request.Builder setReferenceTime (ZonedDateTime referenceTime)
```

<br />

<br />

|                                                                                                                               Parameters                                                                                                                                ||
|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `referenceTime` | `ZonedDateTime`: reference time based on which relative dates (e.g. "tomorrow" should be interpreted. This should usually be the time when the text was originally composed. If no reference time is set, now is used. This value may be`null`. <br /> |

|                                                                                            Returns                                                                                            ||
|----------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------|
| [TextClassification.Request.Builder](https://developer.android.com/reference/android/view/textclassifier/TextClassification.Request.Builder) | this builder This value cannot be`null`. <br /> |