public class AccountState
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static com.google.common.base.Function<AccountState,com.google.gerrit.reviewdb.client.Account.Id> |
ACCOUNT_ID_FUNCTION |
Constructor and Description |
---|
AccountState(com.google.gerrit.reviewdb.client.Account account,
java.util.Set<com.google.gerrit.reviewdb.client.AccountGroup.UUID> actualGroups,
java.util.Collection<com.google.gerrit.reviewdb.client.AccountExternalId> externalIds,
java.util.Map<WatchConfig.ProjectWatchKey,java.util.Set<com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType>> projectWatches) |
Modifier and Type | Method and Description |
---|---|
<T> T |
get(CurrentUser.PropertyKey<T> key)
Lookup a previously stored property.
|
com.google.gerrit.reviewdb.client.Account |
getAccount()
Get the cached account metadata.
|
static java.util.Set<java.lang.String> |
getEmails(java.util.Collection<com.google.gerrit.reviewdb.client.AccountExternalId> ids) |
java.util.Collection<com.google.gerrit.reviewdb.client.AccountExternalId> |
getExternalIds()
The external identities that identify the account holder.
|
java.util.Set<com.google.gerrit.reviewdb.client.AccountGroup.UUID> |
getInternalGroups()
The set of groups maintained directly within the Gerrit database.
|
java.lang.String |
getPassword(java.lang.String username) |
java.util.Map<WatchConfig.ProjectWatchKey,java.util.Set<com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType>> |
getProjectWatches()
The project watches of the account.
|
java.lang.String |
getUserName()
Get the username, if one has been declared for this user.
|
static java.lang.String |
getUserName(java.util.Collection<com.google.gerrit.reviewdb.client.AccountExternalId> ids) |
<T> void |
put(CurrentUser.PropertyKey<T> key,
T value)
Store a property for later retrieval.
|
public static final com.google.common.base.Function<AccountState,com.google.gerrit.reviewdb.client.Account.Id> ACCOUNT_ID_FUNCTION
public AccountState(com.google.gerrit.reviewdb.client.Account account, java.util.Set<com.google.gerrit.reviewdb.client.AccountGroup.UUID> actualGroups, java.util.Collection<com.google.gerrit.reviewdb.client.AccountExternalId> externalIds, java.util.Map<WatchConfig.ProjectWatchKey,java.util.Set<com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType>> projectWatches)
public com.google.gerrit.reviewdb.client.Account getAccount()
public java.lang.String getUserName()
The username is the AccountExternalId
using the scheme
AccountExternalId.SCHEME_USERNAME
.
public java.lang.String getPassword(java.lang.String username)
public java.util.Collection<com.google.gerrit.reviewdb.client.AccountExternalId> getExternalIds()
public java.util.Map<WatchConfig.ProjectWatchKey,java.util.Set<com.google.gerrit.reviewdb.client.AccountProjectWatch.NotifyType>> getProjectWatches()
public java.util.Set<com.google.gerrit.reviewdb.client.AccountGroup.UUID> getInternalGroups()
public static java.lang.String getUserName(java.util.Collection<com.google.gerrit.reviewdb.client.AccountExternalId> ids)
public static java.util.Set<java.lang.String> getEmails(java.util.Collection<com.google.gerrit.reviewdb.client.AccountExternalId> ids)
public <T> T get(CurrentUser.PropertyKey<T> key)
All properties are automatically cleared when the account cache invalidates
the AccountState
. This method is thread-safe.
key
- unique property key.null
.public <T> void put(CurrentUser.PropertyKey<T> key, T value)
This method is thread-safe.
key
- unique property key.value
- value to store; or null
to clear the value.