public final class TextLinks.Builder


A builder to construct a TextLinks instance.

Summary

Public constructors

Create a new TextLinks.Builder.

Public methods

@NonNull TextLinks.Builder
addLink(int start, int end, @NonNull Map<StringFloat> entityScores)

Adds a TextLink.

@NonNull TextLinks

Constructs a TextLinks instance.

@NonNull TextLinks.Builder

Removes all TextLinks.

@NonNull TextLinks.Builder

Sets the extended, vendor specific data.

Public constructors

Builder

public Builder(@NonNull CharSequence fullText)

Create a new TextLinks.Builder.

Parameters
@NonNull CharSequence fullText

The full text to annotate with links.

Public methods

addLink

public @NonNull TextLinks.Builder addLink(int start, int end, @NonNull Map<StringFloat> entityScores)

Adds a TextLink.

Returns
@NonNull TextLinks.Builder

this instance.

Throws
java.lang.IllegalArgumentException

if entityScores is null or empty.

build

public @NonNull TextLinks build()

Constructs a TextLinks instance.

Returns
@NonNull TextLinks

the constructed TextLinks.

clearTextLinks

public @NonNull TextLinks.Builder clearTextLinks()

Removes all TextLinks.

setExtras

public @NonNull TextLinks.Builder setExtras(@Nullable Bundle extras)

Sets the extended, vendor specific data.