Interface RoleMemberCounts
public interface RoleMemberCounts
Wrapper around a map of role IDs to the number of members with the role.
- See Also:
-
Method Summary
Modifier and TypeMethodDescription@Unmodifiable List<RoleMemberCount> asList()Returns an unmodifiable list ofRoleMemberCount.booleancontains(long roleId) Whether the given role ID has a member count.default booleanWhether the given role ID has a member count.default booleanWhether the givenRolehas a member count.intget(long roleId) Gets the number of members with the given role ID.default intGets the number of members with the given role ID.default intGets the number of members with the givenRole.
-
Method Details
-
get
int get(long roleId) Gets the number of members with the given role ID. Returns0if the role is unknown.- Parameters:
roleId- The role ID to get the member count for- Returns:
- The number of members with the corresponding role, or
0
-
get
Gets the number of members with the given role ID. Returns0if the role is unknown.- Parameters:
roleId- The role ID to get the member count for- Returns:
- The number of members with the corresponding role, or
0 - Throws:
IllegalArgumentException- If the provided string is empty ornullNumberFormatException- If the provided string is not a number
-
get
Gets the number of members with the givenRole. Returns0if the role is unknown.- Parameters:
role- The role to get the member count for- Returns:
- The number of members with the corresponding role, or
0 - Throws:
IllegalArgumentException- If the provided role isnull
-
contains
boolean contains(long roleId) Whether the given role ID has a member count.- Parameters:
roleId- The role ID to check a member count for- Returns:
trueif the role has a member count,falseotherwise
-
contains
Whether the given role ID has a member count.- Parameters:
roleId- The role ID to check a member count for- Returns:
trueif the role has a member count,falseotherwise- Throws:
IllegalArgumentException- If the provided string is empty ornullNumberFormatException- If the provided string is not a number
-
contains
Whether the givenRolehas a member count.- Parameters:
role- The role to check a member count for- Returns:
trueif the role has a member count,falseotherwise- Throws:
IllegalArgumentException- If the provided role isnull
-
asList
Returns an unmodifiable list ofRoleMemberCount.- Returns:
- An unmodifiable list of role member counts
-