Class User (2.0.0)

public final class User 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 an authDomain). For normal Google login, authDomain will be set to "gmail.com".

Inheritance

java.lang.Object > User

Constructors

User(String email, @Nullable String authDomain, @Nullable String userId, String federatedIdentity)

public User(String email, @Nullable String authDomain, @Nullable String userId, String federatedIdentity)

Creates a new User with a federated identity.

Parameters
Name Description
email String

an optional field holding the user's email.

authDomain @org.checkerframework.checker.nullness.qual.Nullable java.lang.String

the URL of the identity provider. Could be null.

userId @org.checkerframework.checker.nullness.qual.Nullable java.lang.String

a unique id for this user. Could be null.

federatedIdentity String

a not null asserted federated identity.

User(String email, String authDomain)

public User(String email, String authDomain)

Creates a new User.

Parameters
Name Description
email String

a not null email address.

authDomain String

a not null domain name into which this user has authenticated, or "gmail.com" for normal Google authentication.

User(String email, String authDomain, @Nullable String userId)

public User(String email, String authDomain, @Nullable String userId)

Creates a new User.

Parameters
Name Description
email String

a not null email address.

authDomain String

a not null domain name into which this user has authenticated, or "gmail.com" for normal Google authentication.

userId @org.checkerframework.checker.nullness.qual.Nullable java.lang.String

a possibly-null string uniquely identifying the specified user.

Methods

compareTo(User user)

public int compareTo(User user)
Parameter
Name Description
user User
Returns
Type Description
int

equals(@Nullable Object object)

public boolean equals(@Nullable Object object)
Parameter
Name Description
object @org.checkerframework.checker.nullness.qual.Nullable java.lang.Object
Returns
Type Description
boolean
Overrides

getAuthDomain()

public String getAuthDomain()
Returns
Type Description
String

getEmail()

public String getEmail()
Returns
Type Description
String

getFederatedIdentity()

public String getFederatedIdentity()
Returns
Type Description
String

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.

Returns
Type Description
String

getUserId()

public @Nullable String getUserId()

Returns an opaque string that uniquely identifies the user represented by this User object.

May be null if this User object was created explicitly and no user ID was supplied.

Returns
Type Description
@org.checkerframework.checker.nullness.qual.Nullable java.lang.String

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

toString()

public String toString()
Returns
Type Description
String
Overrides