Builder

class Builder
kotlin.Any
   ↳ androidx.textclassifier.TextLinks.Builder

A builder to construct a TextLinks instance.

Summary

Public constructors
<init>(@NonNull fullText: CharSequence)

Create a new TextLinks.

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

Adds a TextLink.

TextLinks

Constructs a TextLinks instance.

TextLinks.Builder

Removes all TextLinks.

TextLinks.Builder
setExtras(@Nullable extras: Bundle?)

Sets the extended, vendor specific data.

Public constructors

<init>

Builder(@NonNull fullText: CharSequence)

Create a new TextLinks.Builder.

Parameters
fullText CharSequence: The full text to annotate with links.

Public methods

@NonNull fun addLink(
    start: Int,
    end: Int,
    @NonNull entityScores: MutableMap<String!, Float!>
): TextLinks.Builder

Adds a TextLink.

Return
TextLinks.Builder this instance.
Exceptions
IllegalArgumentException if entityScores is null or empty.

build

@NonNull fun build(): TextLinks

Constructs a TextLinks instance.

Return
TextLinks the constructed TextLinks.
@NonNull fun clearTextLinks(): TextLinks.Builder

Removes all TextLinks.

setExtras

@NonNull fun setExtras(@Nullable extras: Bundle?): TextLinks.Builder

Sets the extended, vendor specific data.