# MessageFormat.Field

Added in[API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Fields](https://developer.android.com/reference/android/icu/text/MessageFormat.Field#lfields)\|[Inherited Fields](https://developer.android.com/reference/android/icu/text/MessageFormat.Field#inhfields)\|[Protected Ctors](https://developer.android.com/reference/android/icu/text/MessageFormat.Field#proctors)\|[Protected Methods](https://developer.android.com/reference/android/icu/text/MessageFormat.Field#promethods)\|[Inherited Methods](https://developer.android.com/reference/android/icu/text/MessageFormat.Field#inhmethods)  

# MessageFormat.Field

*** ** * ** ***

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

`
public
static


class
MessageFormat.Field
`  
`


``


``

extends `[Format.Field](https://developer.android.com/reference/java/text/Format.Field)`


``


`

|---|---|---|--------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||||
| ↳ | [java.text.AttributedCharacterIterator.Attribute](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute) |||
|   | ↳ | [java.text.Format.Field](https://developer.android.com/reference/java/text/Format.Field) ||
|   |   | ↳ | android.icu.text.MessageFormat.Field |

<br />

*** ** * ** ***

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

## Summary

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

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         ### Inherited fields                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From class[java.text.AttributedCharacterIterator.Attribute](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute) |---------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` public static final `[AttributedCharacterIterator.Attribute](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute) | [INPUT_METHOD_SEGMENT](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#INPUT_METHOD_SEGMENT) Attribute key for input method segments. | | ` public static final `[AttributedCharacterIterator.Attribute](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute) | [LANGUAGE](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#LANGUAGE) Attribute key for the language of some text.                     | | ` public static final `[AttributedCharacterIterator.Attribute](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute) | [READING](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#READING) Attribute key for the reading of some text.                        | |

|                                                                                                        ### Protected constructors                                                                                                         ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Field](https://developer.android.com/reference/android/icu/text/MessageFormat.Field#Field(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` name) ` Create a`Field`with the specified name. |

|                                                                                                                    ### Protected methods                                                                                                                    ||
|-----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[Object](https://developer.android.com/reference/java/lang/Object) | ` `[readResolve](https://developer.android.com/reference/android/icu/text/MessageFormat.Field#readResolve())`() ` Resolves instances being deserialized to the predefined constants. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.text.AttributedCharacterIterator.Attribute](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute)` ` |-----------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` final boolean`                                                      | ` `[equals](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Compares two objects for equality. | | ` `[String](https://developer.android.com/reference/java/lang/String) | ` `[getName](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#getName())`() ` Returns the name of the attribute.                                                                                       | | ` final int`                                                          | ` `[hashCode](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#hashCode())`() ` Returns a hash code value for the object.                                                                              | | ` `[Object](https://developer.android.com/reference/java/lang/Object) | ` `[readResolve](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#readResolve())`() ` Resolves instances being deserialized to the predefined constants.                                               | | ` `[String](https://developer.android.com/reference/java/lang/String) | ` `[toString](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#toString())`() ` Returns a string representation of the object.                                                                         | ||
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Fields

### ARGUMENT

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

```
public static final MessageFormat.Field ARGUMENT
```

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.

<br />

## Protected constructors

### Field

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

```
protected Field (String name)
```

Create a`Field`with the specified name.

<br />

|                     Parameters                     ||
|--------|--------------------------------------------|
| `name` | `String`: The name of the attribute <br /> |

## Protected methods

### readResolve

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

```
protected Object readResolve ()
```

Resolves instances being deserialized to the predefined constants.

<br />

|                                                     Returns                                                      ||
|--------------------------------------------------------------------|----------------------------------------------|
| [Object](https://developer.android.com/reference/java/lang/Object) | resolved MessageFormat.Field constant <br /> |

|                                                                  Throws                                                                  ||
|--------------------------------------------------------------------------------------------------|----------------------------------------|
| [InvalidObjectException](https://developer.android.com/reference/java/io/InvalidObjectException) | if the constant could not be resolved. |