public class Contact extends Object
This class provides methods to obtain basic attributes of a contact, such as the email address, event information, group information, instant messaging (IM) address, name, nickname, note, organization, phone number, portrait, postal address, relation, SIP address, and website.
SystemCapability.SysAppComponents#CONTACT| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static long |
INVALID_CONTACT_ID |
Indicates an invalid contact ID.
|
| 构造器 | 说明 |
|---|---|
Contact() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
addEmail(Email email) |
Adds an email address to this contact.
|
void |
addEvent(Event event) |
Adds an event (special date) to this contact.
|
void |
addGroup(Group group) |
Adds this contact to a group.
|
void |
addImAddress(ImAddress imAddress) |
Adds an IM address to this contact.
|
void |
addPhoneNumber(PhoneNumber phoneNumber) |
Adds a phone number to this contact.
|
void |
addPostalAddress(PostalAddress postalAddress) |
Adds a postal address to this contact.
|
void |
addRelation(Relation relation) |
Adds a relation to this contact.
|
void |
addSipAddress(SipAddress sipAddress) |
Adds a Session Initiation Protocol (SIP) address to this contact.
|
void |
addWebsite(Website website) |
Adds a website to this contact.
|
List<Email> |
getEmails() |
Obtains the email address list of this contact.
|
List<Event> |
getEvents() |
Obtains the contact event (special date) list.
|
List<Group> |
getGroups() |
Obtains the list of groups to which this contact belongs.
|
long |
getId() |
Obtains the contact ID.
|
List<ImAddress> |
getImAddresses() |
Obtains the list of IM addresses of this contact.
|
String |
getKey() |
Obtains the query key that identifies this contact.
|
Name |
getName() |
Obtains the contact name.
|
NickName |
getNickName() |
Obtains the contact nickName.
|
Note |
getNote() |
Obtains the contact note.
|
Organization |
getOrganization() |
Obtains organization information about this contact.
|
List<PhoneNumber> |
getPhoneNumbers() |
Obtains the phone number list of this contact.
|
Portrait |
getPortrait() |
Obtains the contact portrait.
|
List<PostalAddress> |
getPostalAddresses() |
Obtains the postal address list of this contact.
|
List<Relation> |
getRelations() |
Obtains the relation list of this contact.
|
List<SipAddress> |
getSipAddresses() |
Obtains the list of SIP addresses of this contact.
|
List<Website> |
getWebsites() |
Obtains the website list of this contact.
|
void |
setContactAttributes(ContactAttributes attributes) |
Sets contact attributes.
|
void |
setEmails(List<Email> emails) |
Set emails address to this contact.
|
void |
setEvents(List<Event> events) |
Set event (special date) to this contact.
|
void |
setGroups(List<Group> groups) |
Set this contact to group.
|
void |
setImAddresses(List<ImAddress> imAddresses) |
Set IM address to this contact.
|
void |
setName(Name name) |
Sets a name for this contact.
|
void |
setNickName(NickName nickName) |
Sets a nickName for this contact.
|
void |
setNote(Note note) |
Sets a note for this contact.
|
void |
setOrganization(Organization organization) |
Sets organization information about this contact.
|
void |
setPhoneNumbers(List<PhoneNumber> phoneNumbers) |
Set phone number to this contact.
|
void |
setPortrait(Portrait portrait) |
Sets a portrait for this contact.
|
void |
setPostalAddresses(List<PostalAddress> postalAddresses) |
Set postal address to this contact.
|
void |
setRelations(List<Relation> relations) |
Set relation to this contact.
|
void |
setSipAddresses(List<SipAddress> sipAddresses) |
Set Session Initiation Protocol (SIP) address to this contact.
|
void |
setWebsites(List<Website> websites) |
Set website to this contact.
|
public static final long INVALID_CONTACT_ID
The constant value is -1.
public long getId()
public List<PhoneNumber> getPhoneNumbers()
public void setPhoneNumbers(List<PhoneNumber> phoneNumbers)
phoneNumbers - Indicates the Listpublic void addPhoneNumber(PhoneNumber phoneNumber)
phoneNumber - Indicates the phone number to add.public Portrait getPortrait()
public void setPortrait(Portrait portrait)
portrait - Indicates the contact portrait to set.public Organization getOrganization()
public void setOrganization(Organization organization)
organization - Indicates the organization to set.public Name getName()
public void setName(Name name)
name - Indicates the name to set.public String getKey()
public List<Email> getEmails()
public void setEmails(List<Email> emails)
emails - Indicates the email list.public void addEmail(Email email)
email - Indicates the email address to add.public List<ImAddress> getImAddresses()
public void setImAddresses(List<ImAddress> imAddresses)
imAddresses - Indicates the contact IM address to add List.public void addImAddress(ImAddress imAddress)
imAddress - Indicates the contact IM address to add.public NickName getNickName()
public void setNickName(NickName nickName)
nickName - Indicates the nickName to set.public List<SipAddress> getSipAddresses()
public void setSipAddresses(List<SipAddress> sipAddresses)
sipAddresses - Indicates the SIP address to add list.public void addSipAddress(SipAddress sipAddress)
sipAddress - Indicates the SIP address to add.public List<PostalAddress> getPostalAddresses()
public void setPostalAddresses(List<PostalAddress> postalAddresses)
postalAddresses - Indicates the postal address to add list.public void addPostalAddress(PostalAddress postalAddress)
postalAddress - Indicates the postal address to add.public List<Group> getGroups()
public void setGroups(List<Group> groups)
groups - Indicates the group where the contact is to add list.public void addGroup(Group group)
group - Indicates the group where the contact is to add.public Note getNote()
public void setNote(Note note)
note - Indicates the note to set.public List<Event> getEvents()
public void setEvents(List<Event> events)
events - Indicates the contact event (special date) to add list.public void addEvent(Event event)
event - Indicates the contact event (special date) to add.public List<Website> getWebsites()
public void setWebsites(List<Website> websites)
websites - Indicates the website to add list.public void addWebsite(Website website)
website - Indicates the website to add.public List<Relation> getRelations()
public void setRelations(List<Relation> relations)
relations - Indicates the information about the contact relation to list.public void addRelation(Relation relation)
relation - Indicates the information about the contact relation to set.public void setContactAttributes(ContactAttributes attributes)
attributes - Indicates the ContactAttributes object to set.