# MessageFormat.Field

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

# Field

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/icu/text/MessageFormat.Field "View this page in Java")  

```
open class Field : Format.Field
```

|---|---|---|------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                     ||||
| ↳ | [java.text.AttributedCharacterIterator.Attribute](https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute.html#) |||
|   | ↳ | [java.text.Format.Field](https://developer.android.com/reference/kotlin/java/text/Format.Field.html#)                           ||
|   |   | ↳ | [android.icu.text.MessageFormat.Field](https://developer.android.com/reference/kotlin/android/icu/text/MessageFormat.Field#) |

Defines constants that are used as attribute keys in the`AttributedCharacterIterator`returned from`MessageFormat.formatToCharacterIterator`.

## Summary

|                                                                                                                   Protected constructors                                                                                                                    ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Field](https://developer.android.com/reference/kotlin/android/icu/text/MessageFormat.Field#Field(kotlin.String))`(`name:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Create a`Field`with the specified name. |

|                                                                                                                            Protected methods                                                                                                                             ||
|---------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | [readResolve](https://developer.android.com/reference/kotlin/android/icu/text/MessageFormat.Field#readResolve())`()` Resolves instances being deserialized to the predefined constants. |

|                                                                                                                                                                                        Properties                                                                                                                                                                                         ||
|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[MessageFormat.Field](https://developer.android.com/reference/kotlin/android/icu/text/MessageFormat.Field#)! | [ARGUMENT](https://developer.android.com/reference/kotlin/android/icu/text/MessageFormat.Field#ARGUMENT:android.icu.text.MessageFormat.Field) Constant identifying a portion of a message that was generated from an argument passed into`formatToCharacterIterator`. |

## Protected constructors

### Field

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

```
protected Field(name: String!)
```

Create a`Field`with the specified name.

|                                                     Parameters                                                      ||
|--------|-------------------------------------------------------------------------------------------------------------|
| `name` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:The name of the attribute |

## Protected methods

### readResolve

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

```
protected open fun readResolve(): Any!
```

Resolves instances being deserialized to the predefined constants.

|                                                       Return                                                       ||
|-----------------------------------------------------------------------------|---------------------------------------|
| [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | resolved MessageFormat.Field constant |

|                                Exceptions                                ||
|----------------------------------|----------------------------------------|
| `java.io.InvalidObjectException` | if the constant could not be resolved. |

## Properties

### ARGUMENT

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

```
static val ARGUMENT: MessageFormat.Field!
```

Constant identifying a portion of a message that was generated from an argument passed into`formatToCharacterIterator`. The value associated with the key will be an`Integer`indicating the index in the`arguments`array of the argument from which the text was generated.