Stay organized with collections
Save and categorize content based on your preferences.
Builder
class Builder
Builder class to construct the EntityConfig
object.
Summary
Public constructors
Public methods
includeTypesFromTextClassifier
fun includeTypesFromTextClassifier(includeTypesFromTextClassifier: Boolean): TextClassifier.EntityConfig.Builder
Specifies whether or not to include the types suggested by the text classifier. By default, it is included.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# TextClassifier.EntityConfig.Builder\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBuilder\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/view/textclassifier/TextClassifier.EntityConfig.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.TextClassifier.EntityConfig.Builder](#) |\n\nBuilder class to construct the [EntityConfig](/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig) object.\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------|---|\n| [Builder](#Builder())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|----------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [TextClassifier.EntityConfig](/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig) | [build](#build())`()` Combines all of the options that have been set and returns a new [EntityConfig](/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig) object. |\n| [TextClassifier.EntityConfig.Builder](#) | [includeTypesFromTextClassifier](#includeTypesFromTextClassifier(kotlin.Boolean))`(`includeTypesFromTextClassifier:` `[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)` Specifies whether or not to include the types suggested by the text classifier. |\n| [TextClassifier.EntityConfig.Builder](#) | [setExcludedTypes](#setExcludedTypes(kotlin.collections.MutableCollection))`(`excludedTypes:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\u003e?`)` Sets a collection of types that are explicitly excluded. |\n| [TextClassifier.EntityConfig.Builder](#) | [setHints](#setHints(kotlin.collections.MutableCollection))`(`hints:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\u003e?`)` Sets the hints for the TextClassifier to determine what types of entities to find. |\n| [TextClassifier.EntityConfig.Builder](#) | [setIncludedTypes](#setIncludedTypes(kotlin.collections.MutableCollection))`(`includedTypes:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\u003e?`)` Sets a collection of types that are explicitly included. |\n\nPublic constructors\n-------------------\n\n### Builder\n\n```\nBuilder()\n```\n\nPublic methods\n--------------\n\n### build\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun build(): TextClassifier.EntityConfig\n```\n\nCombines all of the options that have been set and returns a new [EntityConfig](/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig) object.\n\n| Return ||\n|----------------------------------------------------------------------------------------------------------|------------------------------|\n| [TextClassifier.EntityConfig](/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig) | This value cannot be `null`. |\n\n### includeTypesFromTextClassifier\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun includeTypesFromTextClassifier(includeTypesFromTextClassifier: Boolean): TextClassifier.EntityConfig.Builder\n```\n\nSpecifies whether or not to include the types suggested by the text classifier. By default, it is included.\n\n| Return ||\n|------------------------------------------|------------------------------|\n| [TextClassifier.EntityConfig.Builder](#) | This value cannot be `null`. |\n\n### setExcludedTypes\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setExcludedTypes(excludedTypes: MutableCollection\u003cString!\u003e?): TextClassifier.EntityConfig.Builder\n```\n\nSets a collection of types that are explicitly excluded.\n\n| Parameters ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `excludedTypes` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\\\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\\\u003e?: This value may be `null`. |\n\n| Return ||\n|------------------------------------------|------------------------------|\n| [TextClassifier.EntityConfig.Builder](#) | This value cannot be `null`. |\n\n### setHints\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setHints(hints: MutableCollection\u003cString!\u003e?): TextClassifier.EntityConfig.Builder\n```\n\nSets the hints for the TextClassifier to determine what types of entities to find. These hints will only be used if [includeTypesFromTextClassifier](#includeTypesFromTextClassifier(kotlin.Boolean)) is set to be true.\n\n| Parameters ||\n|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `hints` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\\\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\\\u003e?: This value may be `null`. |\n\n| Return ||\n|------------------------------------------|------------------------------|\n| [TextClassifier.EntityConfig.Builder](#) | This value cannot be `null`. |\n\n### setIncludedTypes\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun setIncludedTypes(includedTypes: MutableCollection\u003cString!\u003e?): TextClassifier.EntityConfig.Builder\n```\n\nSets a collection of types that are explicitly included.\n\n| Parameters ||\n|-----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `includedTypes` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\\\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\\\u003e?: This value may be `null`. |\n\n| Return ||\n|------------------------------------------|------------------------------|\n| [TextClassifier.EntityConfig.Builder](#) | This value cannot be `null`. |"]]