Package im.getsocial.sdk.communities
Class User
- java.lang.Object
-
- im.getsocial.sdk.communities.User
-
- Direct Known Subclasses:
GroupMember
,PrivateUser
,ReferralUser
,SuggestedFriend
public class User extends java.lang.Object
Immutable properties for a public user.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
APPLICATION_ID
-
Constructor Summary
Constructors Constructor Description User(java.lang.String userId, java.lang.String displayName, java.lang.String avatarUrl, java.util.Map<java.lang.String,java.lang.String> identities, java.util.Map<java.lang.String,java.lang.String> publicProperties, boolean isVerified)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
java.lang.String
getAvatarUrl()
User avatar url.java.lang.String
getDisplayName()
User display name.java.lang.String
getId()
Unique identifier.java.util.Map<java.lang.String,java.lang.String>
getIdentities()
Returns all auth identities added to the user.java.util.Map<java.lang.String,java.lang.String>
getPublicProperties()
Get all public properties of user.int
hashCode()
boolean
isAnonymous()
boolean
isApp()
boolean
isVerified()
java.lang.String
toString()
-
-
-
Field Detail
-
APPLICATION_ID
public static final java.lang.String APPLICATION_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getIdentities
public java.util.Map<java.lang.String,java.lang.String> getIdentities()
Returns all auth identities added to the user. The key is the providerId and the value is the userId used internally by that provider for this user. You can add or remove identities usingCurrentUser.addIdentity(Identity, CompletionCallback, Callback, FailureCallback)
andCurrentUser.removeIdentity(String, CompletionCallback, FailureCallback)
. The key(providerId) is the one you've passed as a first parameter toIdentity.custom(String, String, String)
orIdentityProviderIds.FACEBOOK
if you've created Facebook identity withIdentity.facebook(String)
. Read more about identities in the documentation. The value(userId) is the second parameter inIdentity.custom(String, String, String)
or automatically obtained by GetSocial if you've used Facebook identity.- Returns:
- The map of all auth identities for the user.
-
getId
public java.lang.String getId()
Unique identifier.- Returns:
- Unique GetSocial user id.
-
getPublicProperties
public java.util.Map<java.lang.String,java.lang.String> getPublicProperties()
Get all public properties of user. The map is a copy of origin user properties.- Returns:
- unmodifiable copy of user public properties.
-
getDisplayName
public java.lang.String getDisplayName()
User display name. It is how user is displayed in GetSocial UI.- Returns:
- User display name.
-
getAvatarUrl
@Nullable public java.lang.String getAvatarUrl()
User avatar url. It is the avatar that is used in GetSocial UI.- Returns:
- User avatar url, or null if not set.
-
isAnonymous
public boolean isAnonymous()
- Returns:
- true, if user is anonymous.
-
isVerified
public boolean isVerified()
- Returns:
- true, if user is verified by application.
-
isApp
public boolean isApp()
- Returns:
- true, if user represent an app. False is it is a normal user.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
-