TextSelection.Builder

public static final class TextSelection.Builder
extends Object

java.lang.Object
   ↳ androidx.textclassifier.TextSelection.Builder


Builder used to build TextSelection objects.

Summary

Public constructors

Builder(int startIndex, int endIndex)

Creates a builder used to build TextSelection objects.

Public methods

TextSelection build()

Builds and returns TextSelection object.

TextSelection.Builder setEntityType(String type, float confidenceScore)

Sets an entity type for the classified text and assigns a confidence score.

TextSelection.Builder setExtras(Bundle extras)

Sets the extended, vendor specific data.

TextSelection.Builder setId(String id)

Sets an id for the TextSelection object.

Inherited methods

Public constructors

Builder

public Builder (int startIndex, 
                int endIndex)

Creates a builder used to build TextSelection objects.

Parameters
startIndex int: the start index of the text selection.

endIndex int: the end index of the text selection. Must be greater than startIndex