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 Type
    Method
    Description
    @Unmodifiable List<RoleMemberCount>
    Returns an unmodifiable list of RoleMemberCount.
    boolean
    contains(long roleId)
    Whether the given role ID has a member count.
    default boolean
    contains(String roleId)
    Whether the given role ID has a member count.
    default boolean
    contains(Role role)
    Whether the given Role has a member count.
    int
    get(long roleId)
    Gets the number of members with the given role ID.
    default int
    get(String roleId)
    Gets the number of members with the given role ID.
    default int
    get(Role role)
    Gets the number of members with the given Role.
  • Method Details

    • get

      int get(long roleId)
      Gets the number of members with the given role ID. Returns 0 if 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

      default int get(@Nonnull String roleId)
      Gets the number of members with the given role ID. Returns 0 if 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 or null
      NumberFormatException - If the provided string is not a number
    • get

      default int get(@Nonnull Role role)
      Gets the number of members with the given Role. Returns 0 if 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 is null
    • 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:
      true if the role has a member count, false otherwise
    • contains

      default boolean contains(@Nonnull String roleId)
      Whether the given role ID has a member count.
      Parameters:
      roleId - The role ID to check a member count for
      Returns:
      true if the role has a member count, false otherwise
      Throws:
      IllegalArgumentException - If the provided string is empty or null
      NumberFormatException - If the provided string is not a number
    • contains

      default boolean contains(@Nonnull Role role)
      Whether the given Role has a member count.
      Parameters:
      role - The role to check a member count for
      Returns:
      true if the role has a member count, false otherwise
      Throws:
      IllegalArgumentException - If the provided role is null
    • asList

      @Nonnull @Unmodifiable List<RoleMemberCount> asList()
      Returns an unmodifiable list of RoleMemberCount.
      Returns:
      An unmodifiable list of role member counts