Person

Added in 1.1.0

public class Person


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 Person.Builder

Builder for the immutable Person class.

Public methods

boolean
equals(@Nullable Object otherObject)
static @NonNull Person

Extracts and returns the Person written to the bundle.

@Nullable IconCompat

Returns the icon for this Person or null if no icon was provided.

@Nullable String

Returns the key for this Person or null if no key was provided.

@Nullable CharSequence

Returns the name for this Person or null if no name was provided.

@Nullable String

Returns the raw URI for this Person or null if no URI was provided.

int
boolean

Returns whether or not this Person is a machine rather than a human.

boolean

Returns whether or not this Person is important to the user of this device with regards to how frequently they interact.

@NonNull Person.Builder

Creates and returns a new Builder initialized with this Person's data.

@NonNull Bundle

Writes and returns a new Bundle that represents this Person.

Public methods

equals

public boolean equals(@Nullable Object otherObject)

fromBundle

Added in 1.1.0
public static @NonNull Person fromBundle(@NonNull Bundle bundle)

Extracts and returns the Person written to the bundle. A bundle can be created from a Person using toBundle.

getIcon

Added in 1.1.0
public @Nullable IconCompat getIcon()

Returns the icon for this Person or null if no icon was provided.

getKey

Added in 1.1.0
public @Nullable String getKey()

Returns the key for this Person or null if no key was provided. This is provided as a unique identifier between other Persons.

getName

Added in 1.1.0
public @Nullable CharSequence getName()

Returns the name for this Person or null if no name was provided. This could be a full name, nickname, username, etc.

getUri

Added in 1.1.0
public @Nullable String getUri()

Returns the raw URI for this Person or null if no URI was provided. A URI can be any of the following:

*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
public boolean isBot()

Returns whether or not this Person is a machine rather than a human. Used primarily to identify automated tooling.

isImportant

Added in 1.1.0
public boolean isImportant()

Returns whether or not this Person is important to the user of this device with regards to how frequently they interact.

toBuilder

Added in 1.1.0
public @NonNull Person.Builder toBuilder()

Creates and returns a new Builder initialized with this Person's data.

toBundle

Added in 1.1.0
public @NonNull Bundle toBundle()

Writes and returns a new Bundle that represents this Person. This bundle can be converted back by using fromBundle.