# Person

# Person

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)  
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 "View this page in Java")

<br />

```
class Person
```

<br />

*** ** * ** ***

Provides an immutable reference to an entity that appears repeatedly on different surfaces of the platform. For example, this could represent the sender of a message.

## Summary

|                                                                                                      ### Nested types                                                                                                      |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[Person.Builder](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder) Builder for the immutable[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)class. |

|                                            ### Public functions                                            |
|------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                        | [equals](https://developer.android.com/reference/kotlin/androidx/core/app/Person#equals(java.lang.Object))`(otherObject: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)`                                                                                                                                  |
| `java-static `[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)            | [fromBundle](https://developer.android.com/reference/kotlin/androidx/core/app/Person#fromBundle(android.os.Bundle))`(bundle: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`)` Extracts and returns the[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)written to the`bundle`. |
| [IconCompat](https://developer.android.com/reference/kotlin/androidx/core/graphics/drawable/IconCompat)`?` | [getIcon](https://developer.android.com/reference/kotlin/androidx/core/app/Person#getIcon())`()` Returns the icon for this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)or`null`if no icon was provided.                                                                                                |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?`                       | [getKey](https://developer.android.com/reference/kotlin/androidx/core/app/Person#getKey())`()` Returns the key for this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)or`null`if no key was provided.                                                                                                    |
| [CharSequence](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html)`?`          | [getName](https://developer.android.com/reference/kotlin/androidx/core/app/Person#getName())`()` Returns the name for this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)or`null`if no name was provided.                                                                                                |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?`                       | [getUri](https://developer.android.com/reference/kotlin/androidx/core/app/Person#getUri())`()` Returns the raw URI for this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)or`null`if no URI was provided.                                                                                                |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                | [hashCode](https://developer.android.com/reference/kotlin/androidx/core/app/Person#hashCode())`()`                                                                                                                                                                                                                                         |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                        | [isBot](https://developer.android.com/reference/kotlin/androidx/core/app/Person#isBot())`()` Returns whether or not this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)is a machine rather than a human.                                                                                                 |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                        | [isImportant](https://developer.android.com/reference/kotlin/androidx/core/app/Person#isImportant())`()` Returns whether or not this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)is important to the user of this device with regards to how frequently they interact.                                 |
| [Person.Builder](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder)          | [toBuilder](https://developer.android.com/reference/kotlin/androidx/core/app/Person#toBuilder())`()` Creates and returns a new[Builder](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder)initialized with this Person's data.                                                                               |
| [Bundle](https://developer.android.com/reference/android/os/Bundle.html)                                   | [toBundle](https://developer.android.com/reference/kotlin/androidx/core/app/Person#toBundle())`()` Writes and returns a new[Bundle](https://developer.android.com/reference/android/os/Bundle.html)that represents this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person).                                  |

## Public functions

### equals

```
fun equals(otherObject: Any?): Boolean
```  

### fromBundle

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

```
java-static fun fromBundle(bundle: Bundle): Person
```

Extracts and returns the[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)written to the`bundle`. A bundle can be created from a[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)using[toBundle](https://developer.android.com/reference/kotlin/androidx/core/app/Person#toBundle()).  

### getIcon

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

```
fun getIcon(): IconCompat?
```

Returns the icon for this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)or`null`if no icon was provided.  

### getKey

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

```
fun getKey(): String?
```

Returns the key for this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)or`null`if no key was provided. This is provided as a unique identifier between other[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)s.  

### getName

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

```
fun getName(): CharSequence?
```

Returns the name for this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)or`null`if no name was provided. This could be a full name, nickname, username, etc.  

### getUri

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

```
fun getUri(): String?
```

Returns the raw URI for this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)or`null`if no URI was provided. A URI 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 should be discarded.  

### hashCode

```
fun hashCode(): Int
```  

### isBot

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

```
fun isBot(): Boolean
```

Returns whether or not this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)is a machine rather than a human. Used primarily to identify automated tooling.  

### isImportant

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

```
fun isImportant(): Boolean
```

Returns whether or not this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person)is important to the user of this device with regards to how frequently they interact.  

### toBuilder

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

```
fun toBuilder(): Person.Builder
```

Creates and returns a new[Builder](https://developer.android.com/reference/kotlin/androidx/core/app/Person.Builder)initialized with this Person's data.  

### toBundle

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

```
fun toBundle(): Bundle
```

Writes and returns a new[Bundle](https://developer.android.com/reference/android/os/Bundle.html)that represents this[Person](https://developer.android.com/reference/kotlin/androidx/core/app/Person). This bundle can be converted back by using[fromBundle](https://developer.android.com/reference/kotlin/androidx/core/app/Person#fromBundle(android.os.Bundle)).