# 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)

*** ** * ** ***


```
public 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 |
|---|
| `public class https://developer.android.com/reference/androidx/core/app/Person.Builder` Builder for the immutable `https://developer.android.com/reference/androidx/core/app/Person` class. |

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

## Public methods

### equals

```
public boolean equals(@Nullable Object otherObject)
```

### fromBundle

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

```
public static @NonNull Person fromBundle(@NonNull Bundle bundle)
```

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

### getIcon

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

```
public @Nullable IconCompat getIcon()
```

Returns the icon for this `https://developer.android.com/reference/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)

```
public @Nullable String getKey()
```

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

### getName

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

```
public @Nullable CharSequence getName()
```

Returns the name for this `https://developer.android.com/reference/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)

```
public @Nullable String getUri()
```

Returns the raw URI for this `https://developer.android.com/reference/androidx/core/app/Person` or `null` if no URI was provided. A URI can be any of the following:

- The `String` representation of a `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

```
public int hashCode()
```

### isBot

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

```
public boolean isBot()
```

Returns whether or not this `https://developer.android.com/reference/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)

```
public boolean isImportant()
```

Returns whether or not this `https://developer.android.com/reference/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)

```
public @NonNull Person.Builder toBuilder()
```

Creates and returns a new `https://developer.android.com/reference/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)

```
public @NonNull Bundle toBundle()
```

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