public class Relation extends Object
SystemCapability.SysAppComponents#CONTACT| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
CUSTOM_LABEL |
Indicates a custom label.
|
static int |
INVALID_LABEL_ID |
Indicates an invalid label ID.
|
static int |
RELATION_ASSISTANT |
Indicates an assistant.
|
static int |
RELATION_BROTHER |
Indicates a brother.
|
static int |
RELATION_CHILD |
Indicates a child.
|
static int |
RELATION_DOMESTIC_PARTNER |
Indicates a domestic partner.
|
static int |
RELATION_FATHER |
Indicates a father.
|
static int |
RELATION_FRIEND |
Indicates a friend.
|
static int |
RELATION_MANAGER |
Indicates a manager.
|
static int |
RELATION_MOTHER |
Indicates a mother.
|
static int |
RELATION_PARENT |
Indicates a parent.
|
static int |
RELATION_PARTNER |
Indicates a partner.
|
static int |
RELATION_REFERRED_BY |
Indicates a referrer.
|
static int |
RELATION_RELATIVE |
Indicates a relative.
|
static int |
RELATION_SISTER |
Indicates a sister.
|
static int |
RELATION_SPOUSE |
TYPE_SPOUSE
|
| 构造器 | 说明 |
|---|---|
Relation(String relationName,
String customLabelName) |
A constructor used to create a
Relation instance based on a specified relation name
and a custom label name. |
Relation(Context ctx,
String relationName,
int labelId) |
A constructor used to create a
Relation instance based on the application context
and a specified relation name and label ID. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
boolean |
equals(Object object) |
Indicates whether some other object is "equal to" this one.
|
String |
getLabelName() |
Obtains the label name of an attribute.
|
String |
getRelationName() |
Obtains the relation name.
|
int |
hashCode() |
Returns a hash code value for the object.
|
void |
setCustomLabelName(String labelName) |
Set custom label data.
|
void |
setLabelId(Context context,
int labelId) |
Set label id and name.
|
void |
setRelationName(String relationName) |
Sets the relation name.
|
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 static final int RELATION_ASSISTANT
public static final int RELATION_BROTHER
public static final int RELATION_CHILD
public static final int RELATION_DOMESTIC_PARTNER
public static final int RELATION_FATHER
public static final int RELATION_FRIEND
public static final int RELATION_MANAGER
public static final int RELATION_MOTHER
public static final int RELATION_PARENT
public static final int RELATION_PARTNER
public static final int RELATION_REFERRED_BY
public static final int RELATION_RELATIVE
public static final int RELATION_SISTER
public static final int RELATION_SPOUSE
public Relation(Context ctx, String relationName, int labelId)
Relation instance based on the application context
and a specified relation name and label ID.
The label ID can be any of the following:
ctx - Indicates the application context.relationName - Indicates the relation name.labelId - Indicates the label ID.public String getRelationName()
public void setRelationName(String relationName)
relationName - Indicates the relation name 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()