public class UserInfo extends Object
This class provides methods for obtaining the user ID and type, setting the user ID and type, and checking whether two users are the same.
SystemCapability.Data#DATA_DISTRIBUTEDDATAMGR| 构造器 | 说明 |
|---|---|
UserInfo() |
A no-argument constructor used to create a
UserInfo instance. |
UserInfo(String userId,
UserType userType) |
A constructor used to create a
UserInfo instance with a specified user ID and type. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
boolean |
equals(Object obj) |
Checks whether this object equals the specified object.
|
String |
getUserId() |
Obtains the user ID.
|
UserType |
getUserType() |
Obtains the user type.
|
int |
hashCode() |
Obtains the hash code of this object.
|
void |
setUserId(String userId) |
Sets the user ID.
|
void |
setUserType(UserType userType) |
Sets the user type.
|
public UserInfo()
UserInfo instance.
The default user type is UserType.SAME_USER_ID.
public String getUserId()
public void setUserId(String userId)
userId - Indicates the user ID to set.public UserType getUserType()
public void setUserType(UserType userType)
userType - Indicates the user type to set.public int hashCode()
hashCode 在类中 ObjectObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public boolean equals(Object obj)
equals 在类中 Objectobj - Indicates the object to compare.true if the two objects are equal; returns false otherwise.Object.hashCode(),
HashMap