public interface GroupMembership
Modifier and Type | Field and Description |
---|---|
static GroupMembership |
EMPTY |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(com.google.gerrit.reviewdb.client.AccountGroup.UUID groupId)
Returns
true when the user this object was created for is a member
of the specified group. |
boolean |
containsAnyOf(Iterable<com.google.gerrit.reviewdb.client.AccountGroup.UUID> groupIds)
Returns
true when the user this object was created for is a member
of any of the specified group. |
Set<com.google.gerrit.reviewdb.client.AccountGroup.UUID> |
getKnownGroups()
Returns the set of groups that can be determined by the implementation.
|
Set<com.google.gerrit.reviewdb.client.AccountGroup.UUID> |
intersection(Iterable<com.google.gerrit.reviewdb.client.AccountGroup.UUID> groupIds)
Returns a set containing an input member of
contains(id) is true. |
static final GroupMembership EMPTY
boolean contains(com.google.gerrit.reviewdb.client.AccountGroup.UUID groupId)
true
when the user this object was created for is a member
of the specified group.boolean containsAnyOf(Iterable<com.google.gerrit.reviewdb.client.AccountGroup.UUID> groupIds)
true
when the user this object was created for is a member
of any of the specified group.Set<com.google.gerrit.reviewdb.client.AccountGroup.UUID> intersection(Iterable<com.google.gerrit.reviewdb.client.AccountGroup.UUID> groupIds)
contains(id)
is true.
This is batch form of contains that returns specific group information. Implementors may implement the method as:
Set<AccountGroup.UUID> r = new HashSet<>(); for (AccountGroup.UUID id : groupIds) if (contains(id)) r.add(id);
Set<com.google.gerrit.reviewdb.client.AccountGroup.UUID> getKnownGroups()
contains(AccountGroup.UUID)
would return true
for, but will at least contain all top level
groups. This restriction stems from the API of some group systems, which
make it expensive to enumerate the members of a group.