Class User
-
- All Implemented Interfaces:
@Serializable() public final class User
Represents the user model returned from mobile server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
User.UserName
public final class
User.Email
-
Field Summary
Fields Modifier and Type Field Description public final static String
ATTR_ID
public final static String
ATTR_USER_NAME
public final static String
ATTR_ROLES
public final static String
ATTR_FAMILY_NAME
public final static String
ATTR_GIVEN_NAME
public final static String
ATTR_EMAILS
public final static String
ATTR_NAME
public final static String
ATTR_EMAIL_VALUE
public final static String
ATTR_DETAIL
private final String
id
private final String
userName
private final List<String>
roles
private final User.UserName
name
private final List<User.Email>
emails
private final JsonElement
detail
-
Constructor Summary
Constructors Constructor Description User(String id, String userName, List<String> roles, User.UserName name, List<User.Email> emails, JsonElement detail)
-
Method Summary
Modifier and Type Method Description final String
getId()
The user id, mandatory. final String
getUserName()
The user name string, mandatory. final List<String>
getRoles()
The assigned roles of this user. final User.UserName
getName()
The UserName type user name property, which contains optional 'familyName' and 'givenName'. final List<User.Email>
getEmails()
The emails of this user. final JsonElement
getDetail()
The detail information, it could be either a JsonPrimitive, JsonObject or JsonArray. String
toString()
final static User
createUserFromJsonString(String jsonString)
Creates user instance from a json string -
-
Constructor Detail
-
User
User(String id, String userName, List<String> roles, User.UserName name, List<User.Email> emails, JsonElement detail)
-
-
Method Detail
-
getId
final String getId()
The user id, mandatory.
-
getUserName
final String getUserName()
The user name string, mandatory.
-
getRoles
final List<String> getRoles()
The assigned roles of this user.
-
getName
final User.UserName getName()
The UserName type user name property, which contains optional 'familyName' and 'givenName'.
-
getEmails
final List<User.Email> getEmails()
The emails of this user.
-
getDetail
final JsonElement getDetail()
The detail information, it could be either a JsonPrimitive, JsonObject or JsonArray. It's up to the client code to parse this information.
-
toString
String toString()
-
createUserFromJsonString
final static User createUserFromJsonString(String jsonString)
Creates user instance from a json string
-
-
-
-