public final class Account
extends java.lang.Object
A user may have multiple identities they can use to login to Gerrit (see ExternalId), but in such cases they always map back to a single Account entity.
Entities "owned" by an Account (that is, their primary key contains the Account.Id
key
as part of their key structure):
AccountGroupMember
: membership of the user in a specific human managed AccountGroup
. Multiple records can exist when the user is a member of more than one group.
AccountSshKey
: user's public SSH keys, for authentication through the internal SSH
daemon. One record per SSH key uploaded by the user, keys are checked in random order until
a match is found.
DiffPreferencesInfo
: user's preferences for rendering side-to-side and unified diff
Modifier and Type | Class and Description |
---|---|
static class |
Account.Id
Key local to Gerrit to identify a user.
|
Modifier and Type | Field and Description |
---|---|
protected Account.Id |
accountId |
protected java.lang.String |
fullName
Full name of the user ("Given-name Surname" style).
|
protected boolean |
inactive
Is this user inactive? This is used to avoid showing some users (eg.
|
protected java.lang.String |
preferredEmail
Email address the user prefers to be contacted through.
|
protected java.sql.Timestamp |
registeredOn
Date and time the user registered with the review server.
|
protected java.lang.String |
status
The user-settable status of this account (e.g.
|
protected java.lang.String |
userName
computed the username selected from the identities.
|
Modifier | Constructor and Description |
---|---|
protected |
Account() |
|
Account(Account.Id newId,
java.sql.Timestamp registeredOn)
Create a new account.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getFullName()
Get the full name of the user ("Given-name Surname" style).
|
GeneralPreferencesInfo |
getGeneralPreferencesInfo() |
Account.Id |
getId()
Get local id of this account, to link with in other entities
|
java.lang.String |
getName(java.lang.String anonymousCowardName)
Formats an account name.
|
java.lang.String |
getNameEmail(java.lang.String anonymousCowardName)
Get the name and email address.
|
java.lang.String |
getPreferredEmail()
Email address the user prefers to be contacted through.
|
java.sql.Timestamp |
getRegisteredOn()
Get the date and time the user first registered.
|
java.lang.String |
getStatus() |
java.lang.String |
getUserName() |
int |
hashCode() |
boolean |
isActive() |
void |
setActive(boolean active) |
void |
setFullName(java.lang.String name)
Set the full name of the user ("Given-name Surname" style).
|
void |
setGeneralPreferences(GeneralPreferencesInfo p) |
void |
setPreferredEmail(java.lang.String addr)
Set the email address the user prefers to be contacted through.
|
void |
setStatus(java.lang.String status) |
void |
setUserName(java.lang.String userName)
Update the computed user name property.
|
protected Account.Id accountId
protected java.sql.Timestamp registeredOn
protected java.lang.String fullName
protected java.lang.String preferredEmail
protected boolean inactive
protected java.lang.String status
protected java.lang.String userName
protected Account()
public Account(Account.Id newId, java.sql.Timestamp registeredOn)
newId
- unique id, see ReviewDb.nextAccountId()
.registeredOn
- when the account was registered.public Account.Id getId()
public java.lang.String getFullName()
public void setFullName(java.lang.String name)
public java.lang.String getPreferredEmail()
public void setPreferredEmail(java.lang.String addr)
public java.lang.String getName(java.lang.String anonymousCowardName)
If the account has a full name, it returns only the full name. Otherwise it returns a longer form that includes the email address.
public java.lang.String getNameEmail(java.lang.String anonymousCowardName)
Example output:
A U. Thor <[email protected]>
: full populated
A U. Thor (12)
: missing email address
Anonymous Coward <[email protected]>
: missing name
Anonymous Coward (12)
: missing name and email address
public java.sql.Timestamp getRegisteredOn()
public GeneralPreferencesInfo getGeneralPreferencesInfo()
public void setGeneralPreferences(GeneralPreferencesInfo p)
public boolean isActive()
public void setActive(boolean active)
public java.lang.String getStatus()
public void setStatus(java.lang.String status)
public java.lang.String getUserName()
public void setUserName(java.lang.String userName)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object