Added in API level 28

Builder


class Builder
kotlin.Any
   ↳ android.view.textclassifier.TextLinks.Builder

A builder to construct a TextLinks instance.

Summary

Public constructors
Builder(fullText: String)

Create a new TextLinks.

Public methods
TextLinks.Builder
addLink(start: Int, end: Int, entityScores: MutableMap<String!, Float!>)

Adds a TextLink.

TextLinks.Builder
addLink(start: Int, end: Int, entityScores: MutableMap<String!, Float!>, extras: Bundle)

Adds a TextLink.

TextLinks

Constructs a TextLinks instance.

TextLinks.Builder

Removes all TextLinks.

TextLinks.Builder
setExtras(extras: Bundle?)

Sets the extended data.

Public constructors

Builder

Added in API level 28
Builder(fullText: String)

Create a new TextLinks.Builder.

Parameters
fullText String: The full text to annotate with links This value cannot be null.

Public methods

Added in API level 28
fun addLink(
    start: Int,
    end: Int,
    entityScores: MutableMap<String!, Float!>
): TextLinks.Builder

Adds a TextLink.

Parameters
start Int: The start index of the identified subsequence
end Int: The end index of the identified subsequence
entityScores MutableMap<String!, Float!>: A mapping of entity type to confidence score This value cannot be null.
Return
TextLinks.Builder This value cannot be null.
Exceptions
java.lang.IllegalArgumentException if entityScores is null or empty.
Added in API level 29
fun addLink(
    start: Int,
    end: Int,
    entityScores: MutableMap<String!, Float!>,
    extras: Bundle
): TextLinks.Builder

Adds a TextLink.

Parameters
extras Bundle: An optional bundle containing custom data related to this TextLink This value cannot be null.
entityScores MutableMap<String!, Float!>: This value cannot be null.
Return
TextLinks.Builder This value cannot be null.

build

Added in API level 28
fun build(): TextLinks

Constructs a TextLinks instance.

Return
TextLinks the constructed TextLinks This value cannot be null.
Added in API level 28
fun clearTextLinks(): TextLinks.Builder

Removes all TextLinks.

Return
TextLinks.Builder This value cannot be null.

setExtras

Added in API level 29
fun setExtras(extras: Bundle?): TextLinks.Builder

Sets the extended data.

Parameters
extras Bundle?: This value may be null.
Return
TextLinks.Builder this builder This value cannot be null.