Package com.google.gerrit.server.account
Class Accounts
- java.lang.Object
-
- com.google.gerrit.server.account.Accounts
-
public class Accounts extends Object
Class to access accounts.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<AccountState>
all()
Returns all accounts.Set<Account.Id>
allIds()
Returns all account IDs.List<Account.Id>
firstNIds(int n)
Returns the first n account IDs.Optional<AccountState>
get(Account.Id accountId)
List<AccountState>
get(Collection<Account.Id> accountIds)
boolean
hasAnyAccount()
Checks if any account exists.static boolean
hasAnyAccount(org.eclipse.jgit.lib.Repository repo)
static Stream<Account.Id>
readUserRefs(org.eclipse.jgit.lib.Repository repo)
-
-
-
Method Detail
-
get
public Optional<AccountState> get(Account.Id accountId) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
get
public List<AccountState> get(Collection<Account.Id> accountIds) throws IOException, org.eclipse.jgit.errors.ConfigInvalidException
- Throws:
IOException
org.eclipse.jgit.errors.ConfigInvalidException
-
all
public List<AccountState> all() throws IOException
Returns all accounts.- Returns:
- all accounts
- Throws:
IOException
-
allIds
public Set<Account.Id> allIds() throws IOException
Returns all account IDs.- Returns:
- all account IDs
- Throws:
IOException
-
firstNIds
public List<Account.Id> firstNIds(int n) throws IOException
Returns the first n account IDs.- Parameters:
n
- the number of account IDs that should be returned- Returns:
- first n account IDs
- Throws:
IOException
-
hasAnyAccount
public boolean hasAnyAccount() throws IOException
Checks if any account exists.- Returns:
true
if at least one account exists, otherwisefalse
- Throws:
IOException
-
hasAnyAccount
public static boolean hasAnyAccount(org.eclipse.jgit.lib.Repository repo) throws IOException
- Throws:
IOException
-
readUserRefs
public static Stream<Account.Id> readUserRefs(org.eclipse.jgit.lib.Repository repo) throws IOException
- Throws:
IOException
-
-