# Field.Builder

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

# Field.Builder

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/service/autofill/Field.Builder "View this page in Kotlin")\|Java

`
public
static
final

class
Field.Builder
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

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

<br />

*** ** * ** ***

A builder for[Field](https://developer.android.com/reference/android/service/autofill/Field)

## Summary

|                                            ### Public constructors                                             ||
|-------------------------------------------------------------------------------------------------------------|---|
| ` `[Builder](https://developer.android.com/reference/android/service/autofill/Field.Builder#Builder())`() ` |

|                                                                                                                                                                                                                                                                            ### Public methods                                                                                                                                                                                                                                                                            ||
|----------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[Field](https://developer.android.com/reference/android/service/autofill/Field)                 | ` `[build](https://developer.android.com/reference/android/service/autofill/Field.Builder#build())`() ` Builds the instance.                                                                                                                                                                                                                                                                                                                                         |
| ` `[Field.Builder](https://developer.android.com/reference/android/service/autofill/Field.Builder) | ` `[setFilter](https://developer.android.com/reference/android/service/autofill/Field.Builder#setFilter(java.util.regex.Pattern))`(`[Pattern](https://developer.android.com/reference/java/util/regex/Pattern)` value) ` 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). |
| ` `[Field.Builder](https://developer.android.com/reference/android/service/autofill/Field.Builder) | ` `[setPresentations](https://developer.android.com/reference/android/service/autofill/Field.Builder#setPresentations(android.service.autofill.Presentations))`(`[Presentations](https://developer.android.com/reference/android/service/autofill/Presentations)` value) ` The presentations used to visualize this field in Autofill UI.                                                                                                                            |
| ` `[Field.Builder](https://developer.android.com/reference/android/service/autofill/Field.Builder) | ` `[setValue](https://developer.android.com/reference/android/service/autofill/Field.Builder#setValue(android.view.autofill.AutofillValue))`(`[AutofillValue](https://developer.android.com/reference/android/view/autofill/AutofillValue)` value) ` The value to be autofilled.                                                                                                                                                                                     |

| ### Inherited methods |
|-----------------------|---|
| 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*.                                                                                             | ||

## Public constructors

### Builder

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

```
public Builder ()
```

<br />

<br />

## Public methods

### build

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

```
public Field build ()
```

Builds the instance. This builder should not be touched after calling this!

<br />

|                                                       Returns                                                       ||
|---------------------------------------------------------------------------------|------------------------------------|
| [Field](https://developer.android.com/reference/android/service/autofill/Field) | This value cannot be`null`. <br /> |

### setFilter

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

```
public Field.Builder setFilter (Pattern value)
```

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 />

|                     Parameters                      ||
|---------|--------------------------------------------|
| `value` | `Pattern`: This value may be`null`. <br /> |

|                                                 Returns                                                 ||
|-------------------------------------------------------------------------------------------------|--------|
| [Field.Builder](https://developer.android.com/reference/android/service/autofill/Field.Builder) | <br /> |

### setPresentations

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

```
public Field.Builder setPresentations (Presentations value)
```

The presentations used to visualize this field in Autofill UI.

<br />

|                          Parameters                          ||
|---------|-----------------------------------------------------|
| `value` | `Presentations`: This value cannot be`null`. <br /> |

|                                                               Returns                                                               ||
|-------------------------------------------------------------------------------------------------|------------------------------------|
| [Field.Builder](https://developer.android.com/reference/android/service/autofill/Field.Builder) | This value cannot be`null`. <br /> |

### setValue

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

```
public Field.Builder setValue (AutofillValue value)
```

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 />

|                          Parameters                          ||
|---------|-----------------------------------------------------|
| `value` | `AutofillValue`: This value cannot be`null`. <br /> |

|                                                 Returns                                                 ||
|-------------------------------------------------------------------------------------------------|--------|
| [Field.Builder](https://developer.android.com/reference/android/service/autofill/Field.Builder) | <br /> |