Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
A builder for building TextLinks requests.
Summary
Public constructors
Public methods
setDefaultLocales
fun setDefaultLocales(defaultLocales: LocaleList?): TextLinks.Request.Builder
Sets ordered list of locale preferences that may be used to disambiguate the provided text.
Parameters |
defaultLocales |
LocaleList?: ordered list of locale preferences that may be used to disambiguate the provided text. If no locale preferences exist, set this to null or an empty locale list. |
setEntityConfig
fun setEntityConfig(entityConfig: TextClassifier.EntityConfig?): TextLinks.Request.Builder
Sets the entity configuration to use. This determines what types of entities the TextClassifier will look for. Set to null
for the default entity config and the TextClassifier will automatically determine what links to generate.
setReferenceTime
fun setReferenceTime(referenceTime: ZonedDateTime?): TextLinks.Request.Builder
Sets the reference time based on which relative dates (e.g. "tomorrow") should be interpreted.
Parameters |
referenceTime |
ZonedDateTime?: reference time based on which relative dates. This should usually be the time when the text was originally composed. This value may be null . |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# TextLinks.Request.Builder\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/textclassifier/TextLinks.Request.Builder \"View this page in Java\") \n\n```\nclass Builder\n```\n\n|---|------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.view.textclassifier.TextLinks.Request.Builder](#) |\n\nA builder for building TextLinks requests.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [Builder](#Builder(kotlin.CharSequence))`(`text:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)`)` \u003cbr /\u003e |\n\n| Public methods ||\n|--------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [TextLinks.Request](/reference/kotlin/android/view/textclassifier/TextLinks.Request) | [build](#build())`()` Builds and returns the request object. |\n| [TextLinks.Request.Builder](#) | [setDefaultLocales](#setDefaultLocales(android.os.LocaleList))`(`defaultLocales:` `[LocaleList](../../os/LocaleList.html#)?`)` Sets ordered list of locale preferences that may be used to disambiguate the provided text. |\n| [TextLinks.Request.Builder](#) | [setEntityConfig](#setEntityConfig(android.view.textclassifier.TextClassifier.EntityConfig))`(`entityConfig:` `[TextClassifier.EntityConfig](/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig)?`)` Sets the entity configuration to use. |\n| [TextLinks.Request.Builder](#)! | [setExtras](#setExtras(android.os.Bundle))`(`extras:` `[Bundle](../../os/Bundle.html#)?`)` Sets the extended data. |\n| [TextLinks.Request.Builder](#) | [setReferenceTime](#setReferenceTime(java.time.ZonedDateTime))`(`referenceTime:` `[ZonedDateTime](../../../java/time/ZonedDateTime.html#)?`)` Sets the reference time based on which relative dates (e.g. \"tomorrow\") should be interpreted. |\n\nPublic constructors\n-------------------\n\n### Builder\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBuilder(text: CharSequence)\n```\n\n| Parameters ||\n|--------|-----------------------------------------------------------------------------------------------------------------------------|\n| `text` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html): This value cannot be `null`. |\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): TextLinks.Request\n```\n\nBuilds and returns the request object.\n\n| Return ||\n|--------------------------------------------------------------------------------------|------------------------------|\n| [TextLinks.Request](/reference/kotlin/android/view/textclassifier/TextLinks.Request) | This value cannot be `null`. |\n\n### setDefaultLocales\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setDefaultLocales(defaultLocales: LocaleList?): TextLinks.Request.Builder\n```\n\nSets ordered list of locale preferences that may be used to disambiguate the provided text.\n\n| Parameters ||\n|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `defaultLocales` | [LocaleList](../../os/LocaleList.html#)?: ordered list of locale preferences that may be used to disambiguate the provided text. If no locale preferences exist, set this to null or an empty locale list. |\n\n| Return ||\n|--------------------------------|-------------------------------------------|\n| [TextLinks.Request.Builder](#) | this builder This value cannot be `null`. |\n\n### setEntityConfig\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setEntityConfig(entityConfig: TextClassifier.EntityConfig?): TextLinks.Request.Builder\n```\n\nSets the entity configuration to use. This determines what types of entities the TextClassifier will look for. Set to `null` for the default entity config and the TextClassifier will automatically determine what links to generate.\n\n| Parameters ||\n|----------------|--------------------------------------------------------------------------------------------------------------------------------------|\n| `entityConfig` | [TextClassifier.EntityConfig](/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig)?: This value may be `null`. |\n\n| Return ||\n|--------------------------------|--------------|\n| [TextLinks.Request.Builder](#) | this builder |\n\n### setExtras\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setExtras(extras: Bundle?): TextLinks.Request.Builder!\n```\n\nSets the extended data.\n\n| Parameters ||\n|----------|-------------------------------------------------------------|\n| `extras` | [Bundle](../../os/Bundle.html#)?: This value may be `null`. |\n\n| Return ||\n|---------------------------------|--------------|\n| [TextLinks.Request.Builder](#)! | this builder |\n\n### setReferenceTime\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setReferenceTime(referenceTime: ZonedDateTime?): TextLinks.Request.Builder\n```\n\nSets the reference time based on which relative dates (e.g. \"tomorrow\") should be interpreted.\n\n| Parameters ||\n|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `referenceTime` | [ZonedDateTime](../../../java/time/ZonedDateTime.html#)?: reference time based on which relative dates. This should usually be the time when the text was originally composed. This value may be `null`. |\n\n| Return ||\n|--------------------------------|-------------------------------------------|\n| [TextLinks.Request.Builder](#) | this builder This value cannot be `null`. |"]]