Package com.google.appengine.api.users
Class User
- java.lang.Object
-
- com.google.appengine.api.users.User
-
- All Implemented Interfaces:
Serializable
,Comparable<User>
public final class User extends Object implements Serializable, Comparable<User>
User
represents a specific user, represented by the combination of an email address and a specific Google Apps domain (which we call anauthDomain
). For normal Google login,authDomain
will be set to "gmail.com".- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description User(String email, @Nullable String authDomain, @Nullable String userId, String federatedIdentity)
Creates a new User with a federated identity.User(String email, String authDomain)
Creates a new User.User(String email, String authDomain, @Nullable String userId)
Creates a new User.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(User user)
boolean
equals(@Nullable Object object)
String
getAuthDomain()
String
getEmail()
String
getFederatedIdentity()
String
getNickname()
Return this user's nickname.@Nullable String
getUserId()
Returns an opaque string that uniquely identifies the user represented by thisUser
object.int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
User
public User(String email, String authDomain)
Creates a new User.- Parameters:
email
- a notnull
email address.authDomain
- a notnull
domain name into which this user has authenticated, or "gmail.com" for normal Google authentication.
-
User
public User(String email, String authDomain, @Nullable String userId)
Creates a new User.- Parameters:
email
- a notnull
email address.authDomain
- a notnull
domain name into which this user has authenticated, or "gmail.com" for normal Google authentication.userId
- a possibly-null string uniquely identifying the specified user.
-
User
public User(String email, @Nullable String authDomain, @Nullable String userId, String federatedIdentity)
Creates a new User with a federated identity.- Parameters:
email
- an optional field holding the user's email.authDomain
- the URL of the identity provider. Could be null.userId
- a unique id for this user. Could be null.federatedIdentity
- a notnull
asserted federated identity.
-
-
Method Detail
-
getNickname
public String getNickname()
Return this user's nickname. The nickname will be a unique, human readable identifier for this user with respect to this application. It will be an email address for some users, but not all.
-
getAuthDomain
public String getAuthDomain()
-
getEmail
public String getEmail()
-
getUserId
public @Nullable String getUserId()
Returns an opaque string that uniquely identifies the user represented by thisUser
object.May be null if this
User
object was created explicitly and no user ID was supplied.
-
getFederatedIdentity
public String getFederatedIdentity()
-
compareTo
public int compareTo(User user)
- Specified by:
compareTo
in interfaceComparable<User>
-
-