# TextClassifier.EntityConfig

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# EntityConfig

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/view/textclassifier/TextClassifier.EntityConfig "View this page in Java")  

```
class EntityConfig : Parcelable
```

|---|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                     ||
| ↳ | [android.view.textclassifier.TextClassifier.EntityConfig](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#) |

Configuration object for specifying what entity types to identify. Configs are initially based on a predefined preset, and can be modified from there.

## Summary

|                                                                                                                                      Nested classes                                                                                                                                       ||
|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|   | [Builder](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig.Builder) Builder class to construct the[EntityConfig](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#)object. |

| Inherited constants ||
|---|---|
| From class[Parcelable](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#) |----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) <br /> Descriptor bit used with[describeContents()](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#describeContents()): indicates that the Parcelable object's flattened representation includes a file descriptor. <br />                                                                                                                                                                                                        | | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int) <br /> Flag for use with[writeToParcel](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#writeToParcel(android.os.Parcel,%20kotlin.Int)): the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point. <br /> | ||

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[TextClassifier.EntityConfig](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#)!                                                             | [create](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#create(kotlin.collections.MutableCollection,%20kotlin.collections.MutableCollection,%20kotlin.collections.MutableCollection))`(`hints:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>?`, `includedEntityTypes:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>?`, `excludedEntityTypes:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>?`)` Creates an EntityConfig. |
| static[TextClassifier.EntityConfig](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#)!                                                             | [createWithExplicitEntityList](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#createWithExplicitEntityList(kotlin.collections.MutableCollection))`(`entityTypes:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>?`)` Creates an EntityConfig with an explicit entity list.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| static[TextClassifier.EntityConfig](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#)!                                                             | [createWithHints](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#createWithHints(kotlin.collections.MutableCollection))`(`hints:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>?`)` Creates an EntityConfig.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                                                                                                                                | [describeContents](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#describeContents())`()` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>! | [getHints](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#getHints())`()` Retrieves the list of hints.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>! | [resolveEntityListModifications](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#resolveEntityListModifications(kotlin.collections.MutableCollection))`(`entityTypes:` `[MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>`)` Returns a final list of entity types to find.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)                                                                                                                        | [shouldIncludeTypesFromTextClassifier](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#shouldIncludeTypesFromTextClassifier())`()` Return whether the client allows the text classifier to include its own list of default types.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                                                                                              | [writeToParcel](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#writeToParcel(android.os.Parcel,%20kotlin.Int))`(`parcel:` `[Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.html#)`, `flags:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

|                                                                                                                                                                                                        Properties                                                                                                                                                                                                         ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.html#)\<[TextClassifier.EntityConfig](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#)!\> | [CREATOR](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#CREATOR:android.os.Parcelable.Creator) <br /> |

## Public methods

### create

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static fun create(
    hints: MutableCollection<String!>?, 
    includedEntityTypes: MutableCollection<String!>?, 
    excludedEntityTypes: MutableCollection<String!>?
): TextClassifier.EntityConfig!
```

**Deprecated:** *Use[Builder](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig.Builder)instead.*

Creates an EntityConfig.

|                                                                                                                                                                                                                                                    Parameters                                                                                                                                                                                                                                                     ||
|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `hints`               | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>?:Hints for the TextClassifier to determine what types of entities to find This value may be`null`.                                                                                                                                                                                |
| `includedEntityTypes` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>?:Entity types, e.g.[TYPE_EMAIL](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier#TYPE_EMAIL:kotlin.String), to explicitly include This value may be`null`.                                                                               |
| `excludedEntityTypes` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>?:Entity types, e.g.[TYPE_PHONE](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier#TYPE_PHONE:kotlin.String), to explicitly exclude Note that if an entity has been excluded, the exclusion will take precedence. This value may be`null`. |

### createWithExplicitEntityList

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static fun createWithExplicitEntityList(entityTypes: MutableCollection<String!>?): TextClassifier.EntityConfig!
```

**Deprecated:** *Use[Builder](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig.Builder)instead.*

Creates an EntityConfig with an explicit entity list.

|                                                                                                                                                                                                      Parameters                                                                                                                                                                                                      ||
|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `entityTypes` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>?:Complete set of entities, e.g.[TYPE_URL](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier#TYPE_URL:kotlin.String)to find. This value may be`null`. |

### createWithHints

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static fun createWithHints(hints: MutableCollection<String!>?): TextClassifier.EntityConfig!
```

**Deprecated:** *Use[Builder](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig.Builder)instead.*

Creates an EntityConfig.

|                                                                                                                                                      Parameters                                                                                                                                                       ||
|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `hints` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>?:Hints for the TextClassifier to determine what types of entities to find. This value may be`null`. |

### describeContents

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun describeContents(): Int
```

|                                                                                                                                                                               Return                                                                                                                                                                               ||
|----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either`0`or[android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#CONTENTS_FILE_DESCRIPTOR:kotlin.Int) |

### getHints

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getHints(): MutableCollection<String!>!
```

Retrieves the list of hints.

|                                                                                                                      Return                                                                                                                       ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------|
| [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!>! | An unmodifiable collection of the hints. |

### resolveEntityListModifications

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun resolveEntityListModifications(entityTypes: MutableCollection<String!>): MutableCollection<String!>!
```

Returns a final list of entity types to find.

|                                                                                                                                                                                             Parameters                                                                                                                                                                                             ||
|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `entityTypes` | [MutableCollection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-collection/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!\>:Entity types we think should be found before factoring in includes/excludes This method is intended for use by TextClassifier implementations. This value cannot be`null`. |

### shouldIncludeTypesFromTextClassifier

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun shouldIncludeTypesFromTextClassifier(): Boolean
```

Return whether the client allows the text classifier to include its own list of default types. If this function returns`true`, a default list of types suggested from a text classifier will be taking into account.

NOTE: This method is intended for use by a text classifier.  
**See Also**

- [#resolveEntityListModifications(Collection)](https://developer.android.com/reference/kotlin/android/view/textclassifier/TextClassifier.EntityConfig#resolveEntityListModifications(kotlin.collections.MutableCollection))  

### writeToParcel

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun writeToParcel(
    parcel: Parcel, 
    flags: Int
): Unit
```

|                                                                                                                                                                                                                                                                                     Parameters                                                                                                                                                                                                                                                                                     ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `dest`  | The Parcel in which the object should be written. This value cannot be`null`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):Additional flags about how the object should be written. May be 0 or[PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int). Value is either`0`or a combination of[android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE](https://developer.android.com/reference/kotlin/android/os/Parcelable.html#PARCELABLE_WRITE_RETURN_VALUE:kotlin.Int), and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |

## Properties

### CREATOR

Added in[API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val CREATOR: Parcelable.Creator<TextClassifier.EntityConfig!>
```