Package net.dv8tion.jda.core.utils.cache
Interface MemberCacheView
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.dv8tion.jda.core.utils.cache.CacheView
CacheView.SimpleCacheView<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Member
getElementById(long id)
Retrieves the member represented by the provided ID.default Member
getElementById(java.lang.String id)
Retrieves the member represented by the provided ID.default java.util.List<Member>
getElementsByNickname(java.lang.String name)
Creates an immutable list of all members matching the given nickname.java.util.List<Member>
getElementsByNickname(java.lang.String name, boolean ignoreCase)
Creates an immutable list of all members matching the given nickname.default java.util.List<Member>
getElementsByUsername(java.lang.String name)
Creates an immutable list of all members matching the given username.java.util.List<Member>
getElementsByUsername(java.lang.String name, boolean ignoreCase)
Creates an immutable list of all members matching the given username.java.util.List<Member>
getElementsWithRoles(java.util.Collection<Role> roles)
Creates an immutable list of all members that hold all of the provided roles.java.util.List<Member>
getElementsWithRoles(Role... roles)
Creates an immutable list of all members that hold all of the provided roles.-
Methods inherited from interface net.dv8tion.jda.core.utils.cache.CacheView
asList, asSet, collect, getElementsByName, getElementsByName, isEmpty, parallelStream, size, stream
-
-
-
-
Method Detail
-
getElementById
Member getElementById(long id)
Retrieves the member represented by the provided ID.- Parameters:
id
- The ID of the member- Returns:
- Possibly-null member for the specified ID
-
getElementById
default Member getElementById(java.lang.String id)
Retrieves the member represented by the provided ID.- Parameters:
id
- The ID of the member- Returns:
- Possibly-null member for the specified ID
- Throws:
java.lang.NumberFormatException
- If the provided String isnull
or cannot be resolved to an unsigned long id
-
getElementsByUsername
java.util.List<Member> getElementsByUsername(java.lang.String name, boolean ignoreCase)
Creates an immutable list of all members matching the given username.
This will check the name of the wrapped user.- Parameters:
name
- The name to checkignoreCase
- Whether to ignore case when comparing usernames- Returns:
- Immutable list of members with the given username
- Throws:
java.lang.IllegalArgumentException
- If the provided name isnull
-
getElementsByUsername
default java.util.List<Member> getElementsByUsername(java.lang.String name)
Creates an immutable list of all members matching the given username.
This will check the name of the wrapped user.- Parameters:
name
- The name to check- Returns:
- Immutable list of members with the given username
- Throws:
java.lang.IllegalArgumentException
- If the provided name isnull
-
getElementsByNickname
java.util.List<Member> getElementsByNickname(@Nullable java.lang.String name, boolean ignoreCase)
Creates an immutable list of all members matching the given nickname.
This will check the nickname of the member. If provided withnull
this will check for members that have no nickname set.- Parameters:
name
- The nullable nickname to checkignoreCase
- Whether to ignore case when comparing nicknames- Returns:
- Immutable list of members with the given nickname
-
getElementsByNickname
default java.util.List<Member> getElementsByNickname(@Nullable java.lang.String name)
Creates an immutable list of all members matching the given nickname.
This will check the nickname of the member. If provided withnull
this will check for members that have no nickname set.- Parameters:
name
- The nullable nickname to check- Returns:
- Immutable list of members with the given nickname
-
getElementsWithRoles
java.util.List<Member> getElementsWithRoles(Role... roles)
Creates an immutable list of all members that hold all of the provided roles.- Parameters:
roles
- Roles the members should have- Returns:
- Immutable list of members with the given roles
- Throws:
java.lang.IllegalArgumentException
- If provided withnull
-
getElementsWithRoles
java.util.List<Member> getElementsWithRoles(java.util.Collection<Role> roles)
Creates an immutable list of all members that hold all of the provided roles.- Parameters:
roles
- Roles the members should have- Returns:
- Immutable list of members with the given roles
- Throws:
java.lang.IllegalArgumentException
- If provided withnull
-
-