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 | |
---|---|
Create a new TextLinks. |
Public methods | |
---|---|
TextLinks.Builder |
Adds a TextLink. |
TextLinks.Builder |
Adds a TextLink. |
TextLinks |
build() Constructs a TextLinks instance. |
TextLinks.Builder |
Removes all |
TextLinks.Builder |
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
addLink
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. |
addLink
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 . |
See Also
build
Added in API level 28
fun build(): TextLinks
Constructs a TextLinks instance.
Return | |
---|---|
TextLinks |
the constructed TextLinks This value cannot be null . |
clearTextLinks
Added in API level 28
fun clearTextLinks(): TextLinks.Builder
Removes all TextLink
s.
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 . |