public class

Person.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.core.app.Person.Builder

Overview

Builder for the immutable Person class.

Summary

Constructors
publicBuilder()

Creates a new, empty Person.Builder.

Methods
public Personbuild()

Creates and returns the Person this builder represents.

public Person.BuildersetBot(boolean bot)

Sets whether or not this Person represents a machine rather than a human.

public Person.BuildersetIcon(IconCompat icon)

Set an icon for this Person.

public Person.BuildersetImportant(boolean important)

Sets whether this is an important person.

public Person.BuildersetKey(java.lang.String key)

Set a unique identifier for this Person.

public Person.BuildersetName(java.lang.CharSequence name)

Give this Person a name to use for display.

public Person.BuildersetUri(java.lang.String uri)

Set a URI for this Person which can be any of the following:

  • The String representation of a
  • A mailto: schema*
  • A tel: schema*

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Creates a new, empty Person.Builder.

Methods

public Person.Builder setName(java.lang.CharSequence name)

Give this Person a name to use for display. This can be, for example, a full name, nickname, username, etc.

public Person.Builder setIcon(IconCompat icon)

Set an icon for this Person.

The system will prefer this icon over any images that are resolved from Person.Builder.setUri(String).

public Person.Builder setUri(java.lang.String uri)

Set a URI for this Person which can be any of the following:

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

public Person.Builder setKey(java.lang.String key)

Set a unique identifier for this Person. This is especially useful if the Person.Builder.setName(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.

public Person.Builder setBot(boolean bot)

Sets whether or not this Person represents a machine rather than a human. This is used primarily for testing and automated tooling.

public Person.Builder setImportant(boolean important)

Sets whether this is an important person. Use this method to denote users who frequently interact with the user of this device when Person.Builder.setUri(String) isn't provided with , and instead with the mailto: or tel: schemas.

public Person build()

Creates and returns the Person this builder represents.