# Person.Builder

# Person.Builder

Artifact:[androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core)  
[View Source](https://cs.android.com/search?q=file:androidx/core/app/Person.java+class:androidx.core.app.Person.Builder)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/app/Person.Builder "View this page in Java")

<br />

```
class Person.Builder
```

<br />

*** ** * ** ***

Builder for the immutable[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)class.

## Summary

|                                                                                                 ### Public constructors                                                                                                  |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Builder](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder#Builder())`()` Creates a new, empty[Builder](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder). |

|                                       ### Public functions                                        |
|---------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)                 | [build](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder#build())`()` Creates and returns the[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)this builder represents.                                                                                                                                     |
| [Person.Builder](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder) | [setBot](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder#setBot(boolean))`(bot: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Sets whether or not this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)represents a machine rather than a human.                |
| [Person.Builder](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder) | [setIcon](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder#setIcon(androidx.core.graphics.drawable.IconCompat))`(icon: `[IconCompat](https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/IconCompat)`?)` Set an icon for this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person). |
| [Person.Builder](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder) | [setImportant](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder#setImportant(boolean))`(important: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Sets whether this is an important person.                                                                                                       |
| [Person.Builder](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder) | [setKey](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder#setKey(java.lang.String))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?)` Set a unique identifier for this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person).                                        |
| [Person.Builder](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder) | [setName](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder#setName(java.lang.CharSequence))`(name: `[CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`?)` Give this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)a name to use for display.                |
| [Person.Builder](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder) | [setUri](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder#setUri(java.lang.String))`(uri: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?)` Set a URI for this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)which can be any of the following:                     |

## Public constructors

### Builder

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
Builder()
```

Creates a new, empty[Builder](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder).  

## Public functions

### build

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun build(): Person
```

Creates and returns the[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)this builder represents.  

### setBot

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setBot(bot: Boolean): Person.Builder
```

Sets whether or not this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)represents a machine rather than a human. This is used primarily for testing and automated tooling.  

### setIcon

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setIcon(icon: IconCompat?): Person.Builder
```

Set an icon for this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person).

The system will prefer this icon over any images that are resolved from[setUri](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder#setUri(java.lang.String)).  

### setImportant

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setImportant(important: Boolean): Person.Builder
```

Sets whether this is an important person. Use this method to denote users who frequently interact with the user of this device when[setUri](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder#setUri(java.lang.String))isn't provided with[CONTENT_LOOKUP_URI](https://developer.android.com/reference/android/provider/ContactsContract.Contacts.html#CONTENT_LOOKUP_URI()), and instead with the`mailto:`or`tel:`schemas.  

### setKey

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setKey(key: String?): Person.Builder
```

Set a unique identifier for this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person). This is especially useful if the[setName](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder#setName(java.lang.CharSequence))value isn't unique. This value is preferred for identification, but if it's not provided, the person's name will be used in its place.  

### setName

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setName(name: CharSequence?): Person.Builder
```

Give this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)a name to use for display. This can be, for example, a full name, nickname, username, etc.  

### setUri

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)  

```
fun setUri(uri: String?): Person.Builder
```

Set a URI for this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)which can be any of the following:

- The`String`representation of a[CONTENT_LOOKUP_URI](https://developer.android.com/reference/android/provider/ContactsContract.Contacts.html#CONTENT_LOOKUP_URI())
- A`mailto:`schema\*
- A`tel:`schema\*

\*Note for these schemas, the path portion of the URI must exist in the contacts database in their appropriate column, otherwise the reference will be discarded.