Builder
class Builder
kotlin.Any | |
↳ | android.app.Person.Builder |
Builder for the immutable Person
class.
Summary
Public constructors | |
---|---|
Builder() Creates a new, empty |
Public methods | |
---|---|
open Person |
build() Creates and returns the |
open Person.Builder |
Sets whether this person is a machine rather than a human. |
open Person.Builder |
Add an icon for this person. |
open Person.Builder |
setImportant(isImportant: Boolean) Sets whether this is an important person. |
open Person.Builder |
Add a key to this person in order to uniquely identify it. |
open Person.Builder |
setName(name: CharSequence?) Give this person a name. |
open Person.Builder |
Set a URI associated with this person. |
Public constructors
Public methods
build
open fun build(): Person
Creates and returns the Person
this builder represents.
Return | |
---|---|
Person |
This value cannot be null . |
setBot
open fun setBot(isBot: Boolean): Person.Builder
Sets whether this person is a machine rather than a human.
Parameters | |
---|---|
isBot |
Boolean: true if this person is a machine, false otherwise. |
Return | |
---|---|
Person.Builder |
This value cannot be null . |
setIcon
open fun setIcon(icon: Icon?): Person.Builder
Add an icon for this person.
The system will prefer this icon over any images that are resolved from the URI.
Parameters | |
---|---|
icon |
Icon?: the icon of the person. This value may be null . |
Return | |
---|---|
Person.Builder |
This value cannot be null . |
setImportant
open fun setImportant(isImportant: Boolean): Person.Builder
Sets whether this is an important person. Use this method to denote users who frequently interact with the user of this device when setUri(java.lang.String)
isn't provided with android.provider.ContactsContract.Contacts#CONTENT_LOOKUP_URI
, and instead with the mailto:
or tel:
schemas.
Parameters | |
---|---|
isImportant |
Boolean: true if this is an important person, false otherwise. |
Return | |
---|---|
Person.Builder |
This value cannot be null . |
setKey
open fun setKey(key: String?): Person.Builder
Add a key to this person in order to uniquely identify it. This is especially useful if the name doesn't uniquely identify this person or if the display name is a short handle of the actual name.
If no key is provided, the name serves as the key for the purpose of identification.
Parameters | |
---|---|
key |
String?: the key that uniquely identifies this person. This value may be null . |
Return | |
---|---|
Person.Builder |
This value cannot be null . |
setName
open fun setName(name: CharSequence?): Person.Builder
Give this person a name.
Parameters | |
---|---|
name |
CharSequence?: the name of this person. This value may be null . |
Return | |
---|---|
Person.Builder |
This value cannot be null . |
setUri
open fun setUri(uri: String?): Person.Builder
Set a URI associated with this person.
The person should be specified by the String
representation of a android.provider.ContactsContract.Contacts#CONTENT_LOOKUP_URI
.
The system will also attempt to resolve mailto:
and tel:
schema URIs. The path part of these URIs must exist in the contacts database, in the appropriate column, or the reference will be discarded as invalid. Telephone schema URIs will be resolved by android.provider.ContactsContract.PhoneLookup
.
Parameters | |
---|---|
uri |
String?: a URI for the person. This value may be null . |
Return | |
---|---|
Person.Builder |
This value cannot be null . |