public class PostalAddress extends Object
SystemCapability.SysAppComponents#CONTACT| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
ADDR_HOME |
Indicates a home address.
|
static int |
ADDR_OTHER |
Indicates an address of the
OTHER type. |
static int |
ADDR_WORK |
Indicates a work address.
|
static int |
CUSTOM_LABEL |
Indicates a custom label.
|
static int |
INVALID_LABEL_ID |
Indicates an invalid label ID.
|
| 构造器 | 说明 |
|---|---|
PostalAddress(String postalAddress,
String customLabelName) |
A constructor used to create a
PostalAddress instance based on a specified postal
address and a custom label name. |
PostalAddress(Context context,
String postalAddress,
int labelId) |
A constructor used to create a
PostalAddress instance based on the application
context and a specified postal address and label ID. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
boolean |
equals(Object object) |
Indicates whether some other object is "equal to" this one.
|
String |
getCity() |
Obtains the city where this contact is located.
|
String |
getCountry() |
Obtains the country/region where this contact is located.
|
String |
getLabelName() |
Obtains the label name of an attribute.
|
String |
getNeighborhood() |
Obtains the neighborhood where this contact is located.
|
String |
getPobox() |
Obtains the post box of this contact.
|
String |
getPostalAddress() |
Obtains the postal address of this contact.
|
String |
getPostcode() |
Obtains the postal code of this contact.
|
String |
getRegion() |
Obtains the area where this contact is located.
|
String |
getStreet() |
Obtains the street where this contact is located.
|
int |
hashCode() |
Returns a hash code value for the object.
|
void |
setCity(String city) |
Sets the city where this contact is located.
|
void |
setCountry(String country) |
Sets the country/region where this contact is located.
|
void |
setCustomLabelName(String labelName) |
Set custom label data.
|
void |
setLabelId(Context context,
int labelId) |
Set label id and name.
|
void |
setNeighborhood(String neighborhood) |
Sets the neighborhood for this contact.
|
void |
setPobox(String pobox) |
Sets the post box for this contact.
|
void |
setPostalAddress(String postalAddress) |
Sets the postal address for this contact.
|
void |
setPostcode(String postcode) |
Sets the postal code for this contact.
|
void |
setRegion(String region) |
Sets the area where this contact is located.
|
void |
setStreet(String street) |
Sets the street where this contact is located.
|
public static final int ADDR_HOME
public static final int ADDR_OTHER
OTHER type.public static final int ADDR_WORK
public static final int CUSTOM_LABEL
If this label type is used, attribute CustomLabelName must be set.
public static final int INVALID_LABEL_ID
public PostalAddress(Context context, String postalAddress, int labelId)
PostalAddress instance based on the application
context and a specified postal address and label ID.
The label ID can be any of the following:
context - Indicates the application context.postalAddress - Indicates the postal address.labelId - Indicates the label ID.public PostalAddress(String postalAddress, String customLabelName)
PostalAddress instance based on a specified postal
address and a custom label name.postalAddress - Indicates the postal address.customLabelName - Indicates the custom label name.public String getStreet()
public void setStreet(String street)
street - Indicates the street to set.public String getPobox()
public void setPobox(String pobox)
pobox - Indicates the post box to set.public String getNeighborhood()
public void setNeighborhood(String neighborhood)
neighborhood - Indicates the neighborhood to set.public String getCity()
public void setCity(String city)
city - Indicates the city to set.public String getRegion()
public void setRegion(String region)
region - Indicates the area to set.public String getPostcode()
public void setPostcode(String postcode)
postcode - Indicates the postal code to set.public String getCountry()
public void setCountry(String country)
country - Indicates the country/region to set.public String getPostalAddress()
public void setPostalAddress(String postalAddress)
postalAddress - Indicates the postal address to set.public void setCustomLabelName(String labelName)
labelName - Indicates the custom label name to set.public int hashCode()
HashMap.hashCode 在类中 ObjectObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public void setLabelId(Context context, int labelId)
context - Indicates the application context.labelId - Indicates the label ID to set.public boolean equals(Object object)
equals 在类中 Objectobj - the reference object with which to compare.true if this object is the same as the obj argument;
false otherwise.Object.hashCode(),
HashMappublic String getLabelName()