# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# TextClassification.Builder

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

java.lang.Object
↳ | android.view.textclassifier.TextClassification.Builder

Builder for building `TextClassification` objects.

e.g.

    TextClassification classification = new TextClassification.Builder()
              .setText(classifiedText)
              .setEntityType(TextClassifier.TYPE_EMAIL, 0.9)
              .setEntityType(TextClassifier.TYPE_OTHER, 0.1)
              .addAction(remoteAction1)
              .addAction(remoteAction2)
              .build();

## Summary

### Public constructors
`Builder()`

### Public methods
`TextClassification.Builder` | `addAction(RemoteAction action)` Adds an action that may be performed on the classified text.
`TextClassification` | `build()` Builds and returns a `TextClassification` object.
`TextClassification.Builder` | `setEntityType(String type, float confidenceScore)` Sets an entity type for the classification result and assigns a confidence score.
`TextClassification.Builder` | `setExtras(Bundle extras)` Sets the extended data.
`TextClassification.Builder` | `setIcon(Drawable icon)` This method is deprecated. Use `addAction(android.app.RemoteAction)` instead.
`TextClassification.Builder` | `setId(String id)` Sets an id for the TextClassification object.
`TextClassification.Builder` | `setIntent(Intent intent)` This method is deprecated. Use `addAction(android.app.RemoteAction)` instead.
`TextClassification.Builder` | `setLabel(String label)` This method is deprecated. Use `addAction(android.app.RemoteAction)` instead.
`TextClassification.Builder` | `setOnClickListener(View.OnClickListener onClickListener)` This method is deprecated. Use `addAction(android.app.RemoteAction)` instead.
`TextClassification.Builder` | `setText(String text)` Sets the classified text.

### 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

### addAction

    public TextClassification.Builder addAction (RemoteAction action)

Adds an action that may be performed on the classified text. Actions should be added in order of likelihood that the user will use them, with the most likely action being added first.

Parameters
`action` | `RemoteAction`: This value cannot be `null`.

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

### build

    public TextClassification build ()

Builds and returns a `TextClassification` object.

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

### setEntityType

    public TextClassification.Builder setEntityType (String type,
                    float confidenceScore)

Sets an entity type for the classification result and assigns a confidence score. If a confidence score had already been set for the specified entity type, this will override that score.

Parameters
`type` | `String`: This value cannot be `null`. Value is `TextClassifier.TYPE_UNKNOWN`, `TextClassifier.TYPE_OTHER`, `TextClassifier.TYPE_EMAIL`, `TextClassifier.TYPE_PHONE`, `TextClassifier.TYPE_ADDRESS`, `TextClassifier.TYPE_URL`, `TextClassifier.TYPE_DATE`, `TextClassifier.TYPE_DATE_TIME`, `TextClassifier.TYPE_FLIGHT_NUMBER`, or android.view.textclassifier.TextClassifier.TYPE_DICTIONARY
`confidenceScore` | `float`: a value from 0 (low confidence) to 1 (high confidence). 0 implies the entity does not exist for the classified text. Values greater than 1 are clamped to 1. Value is between 0.0 and 1.0 inclusive

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

### setExtras

    public TextClassification.Builder setExtras (Bundle extras)

Sets the extended data.

Parameters
`extras` | `Bundle`: This value may be `null`.

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

### setIcon

    public TextClassification.Builder setIcon (Drawable icon)

This method is deprecated.
Use `addAction(android.app.RemoteAction)` instead.

Sets the icon for the primary action that may be rendered on a widget used to act on the classified text.

NOTE: This field is not parcelled. If read from a parcel, the returned icon represents the icon of the first `RemoteAction` (if one exists).

Parameters
`icon` | `Drawable`: This value may be `null`.

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

### setId

    public TextClassification.Builder setId (String id)

Sets an id for the TextClassification object.

Parameters
`id` | `String`: This value may be `null`.

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

### setIntent

    public TextClassification.Builder setIntent (Intent intent)

This method is deprecated.
Use `addAction(android.app.RemoteAction)` instead.

Sets the intent for the primary action that may be fired to act on the classified text.

NOTE: This field is not parcelled.

Parameters
`intent` | `Intent`: This value may be `null`.

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

### setLabel

    public TextClassification.Builder setLabel (String label)

This method is deprecated.
Use `addAction(android.app.RemoteAction)` instead.

Sets the label for the primary action that may be rendered on a widget used to act on the classified text.

NOTE: This field is not parcelled. If read from a parcel, the returned label represents the label of the first `RemoteAction` (if one exists).

Parameters
`label` | `String`: This value may be `null`.

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

### setOnClickListener

    public TextClassification.Builder setOnClickListener (View.OnClickListener onClickListener)

This method is deprecated.
Use `addAction(android.app.RemoteAction)` instead.

Sets the OnClickListener for the primary action that may be triggered to act on the classified text.

NOTE: This field is not parcelable. If read from a parcel, the returned OnClickListener represents the first `RemoteAction` (if one exists).

Parameters
`onClickListener` | `View.OnClickListener`: This value may be `null`.

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

### setText

    public TextClassification.Builder setText (String text)

Sets the classified text.

Parameters
`text` | `String`: This value may be `null`.

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