Person
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.BuilderBuilder for the immutable |
Public methods |
|
|---|---|
boolean |
|
static @NonNull Person |
fromBundle(@NonNull Bundle bundle)Extracts and returns the |
@Nullable IconCompat |
getIcon()Returns the icon for this |
@Nullable String |
getKey()Returns the key for this |
@Nullable CharSequence |
getName()Returns the name for this |
@Nullable String |
getUri()Returns the raw URI for this |
int |
hashCode() |
boolean |
isBot()Returns whether or not this |
boolean |
Returns whether or not this |
@NonNull Person.Builder |
Creates and returns a new |
@NonNull Bundle |
toBundle()Writes and returns a new |
Public methods
fromBundle
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
public @Nullable IconCompat getIcon()
Returns the icon for this Person or null if no icon was provided.
getKey
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
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
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:
- The
Stringrepresentation of aCONTENT_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.
isBot
public boolean isBot()
Returns whether or not this Person is a machine rather than a human. Used primarily to identify automated tooling.
isImportant
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
public @NonNull Person.Builder toBuilder()
Creates and returns a new Builder initialized with this Person's data.