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

# RecognitionPart.Builder

*** ** * ** ***


`
public
static
final

class
RecognitionPart.Builder
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.speech.RecognitionPart.Builder |

<br />

*** ** * ** ***

A builder for `https://developer.android.com/reference/android/speech/RecognitionPart`

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/speech/RecognitionPart.Builder#Builder(java.lang.String)(https://developer.android.com/reference/java/lang/String rawText) ` Creates a new Builder. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/speech/RecognitionPart` | ` https://developer.android.com/reference/android/speech/RecognitionPart.Builder#build()() ` Builds the instance. |
| ` https://developer.android.com/reference/android/speech/RecognitionPart.Builder` | ` https://developer.android.com/reference/android/speech/RecognitionPart.Builder#setConfidenceLevel(int)(int value) ` The level of confidence for this part if requested with `https://developer.android.com/reference/android/speech/RecognizerIntent#EXTRA_REQUEST_WORD_CONFIDENCE`. |
| ` https://developer.android.com/reference/android/speech/RecognitionPart.Builder` | ` https://developer.android.com/reference/android/speech/RecognitionPart.Builder#setFormattedText(java.lang.String)(https://developer.android.com/reference/java/lang/String value) ` The formatted text version of the recognized part of the result. |
| ` https://developer.android.com/reference/android/speech/RecognitionPart.Builder` | ` https://developer.android.com/reference/android/speech/RecognitionPart.Builder#setRawText(java.lang.String)(https://developer.android.com/reference/java/lang/String value) ` The `non-null` raw text version of the recognized part of the result. |
| ` https://developer.android.com/reference/android/speech/RecognitionPart.Builder` | ` https://developer.android.com/reference/android/speech/RecognitionPart.Builder#setTimestampMillis(long)(long value) ` Non-negative offset of the beginning of this part from the start of the recognition session in milliseconds if requested with `https://developer.android.com/reference/android/speech/RecognizerIntent#EXTRA_REQUEST_WORD_TIMING`. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` 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 https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` 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` | ` 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` | ` 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 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Builder (String rawText)
```

Creates a new Builder.

<br />

| Parameters ||
|---|---|
| `rawText` | `String`: The `non-null` raw text version of the recognized part of the result. <br /> |

## Public methods

### build

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

```
public RecognitionPart build ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/speech/RecognitionPart` | This value cannot be `null`. <br /> |

### setConfidenceLevel

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

```
public RecognitionPart.Builder setConfidenceLevel (int value)
```

The level of confidence for this part if requested
with `https://developer.android.com/reference/android/speech/RecognizerIntent#EXTRA_REQUEST_WORD_CONFIDENCE`.

Otherwise, this should equal `https://developer.android.com/reference/android/speech/RecognitionPart#CONFIDENCE_LEVEL_UNKNOWN`.

<br />

| Parameters ||
|---|---|
| `value` | `int`: Value is one of the following: - `https://developer.android.com/reference/android/speech/RecognitionPart#CONFIDENCE_LEVEL_UNKNOWN` - `https://developer.android.com/reference/android/speech/RecognitionPart#CONFIDENCE_LEVEL_LOW` - `https://developer.android.com/reference/android/speech/RecognitionPart#CONFIDENCE_LEVEL_MEDIUM_LOW` - `https://developer.android.com/reference/android/speech/RecognitionPart#CONFIDENCE_LEVEL_MEDIUM` - `https://developer.android.com/reference/android/speech/RecognitionPart#CONFIDENCE_LEVEL_MEDIUM_HIGH` - `https://developer.android.com/reference/android/speech/RecognitionPart#CONFIDENCE_LEVEL_HIGH` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/speech/RecognitionPart.Builder` | This value cannot be `null`. <br /> |

### setFormattedText

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

```
public RecognitionPart.Builder setFormattedText (String value)
```

The formatted text version of the recognized part of the result. If formatting is enabled
with `https://developer.android.com/reference/android/speech/RecognizerIntent#EXTRA_ENABLE_FORMATTING`, it has a `non-null` value.

Otherwise, it should be `null` by default.

<br />

| Parameters ||
|---|---|
| `value` | `String`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/speech/RecognitionPart.Builder` | <br /> |

### setRawText

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

```
public RecognitionPart.Builder setRawText (String value)
```

The `non-null` raw text version of the recognized part of the result.

<br />

| Parameters ||
|---|---|
| `value` | `String`: This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/speech/RecognitionPart.Builder` | <br /> |

### setTimestampMillis

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

```
public RecognitionPart.Builder setTimestampMillis (long value)
```

Non-negative offset of the beginning of this part from
the start of the recognition session in milliseconds
if requested with `https://developer.android.com/reference/android/speech/RecognizerIntent#EXTRA_REQUEST_WORD_TIMING`.

Otherwise, this should equal 0.

<br />

| Parameters ||
|---|---|
| `value` | `long` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/speech/RecognitionPart.Builder` | This value cannot be `null`. <br /> |