Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/service/autofill/Field#nestedclasses) \| [Methods](https://developer.android.com/reference/android/service/autofill/Field#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/service/autofill/Field#inhmethods)

# Field

*** ** * ** ***


`
public

final

class
Field
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.service.autofill.Field |

<br />

*** ** * ** ***

This class is used to set all information of a field. Such as the `https://developer.android.com/reference/android/view/autofill/AutofillValue`
to be autofilled, a [explicit filter](https://developer.android.com/reference/android/service/autofill/Field#Filtering), and presentations to be
visualized, etc.

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/service/autofill/Field.Builder` A builder for `https://developer.android.com/reference/android/service/autofill/Field` |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/java/util/regex/Pattern` | ` https://developer.android.com/reference/android/service/autofill/Field#getFilter()() ` Regex used to determine if the dataset should be shown in the autofill UI; when `null`, it disables filtering on that dataset (this is the recommended approach when `value` is not `null` and field contains sensitive data such as passwords). |
| ` https://developer.android.com/reference/android/service/autofill/Presentations` | ` https://developer.android.com/reference/android/service/autofill/Field#getPresentations()() ` The presentations used to visualize this field in Autofill UI. |
| ` https://developer.android.com/reference/android/view/autofill/AutofillValue` | ` https://developer.android.com/reference/android/service/autofill/Field#getValue()() ` The value to be autofilled. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` 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 https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` 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` | ` 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` | ` 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*. | ||

## Public methods

### getFilter

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

```
public Pattern getFilter ()
```

Regex used to determine if the dataset should be shown in the autofill UI;
when `null`, it disables filtering on that dataset (this is the recommended
approach when `value` is not `null` and field contains sensitive data
such as passwords).

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/regex/Pattern` | <br /> |

### getPresentations

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

```
public Presentations getPresentations ()
```

The presentations used to visualize this field in Autofill UI.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/service/autofill/Presentations` | This value may be `null`. <br /> |

### getValue

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

```
public AutofillValue getValue ()
```

The value to be autofilled. Pass `null` if you do not have the value
but the target view is a logical part of the dataset. For example, if the
dataset needs authentication and you have no access to the value.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/autofill/AutofillValue` | <br /> |