Package net.dv8tion.jda.api.utils.cache
Interface UnifiedMemberCacheView
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.dv8tion.jda.api.utils.cache.CacheView
CacheView.SimpleCacheView<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<Member>
getElementsById(long id)
Retrieves all member represented by the provided ID.default List<Member>
getElementsById(String id)
Retrieves all member represented by the provided ID.default List<Member>
getElementsByNickname(String name)
Creates an immutable list of all members matching the given nickname.List<Member>
getElementsByNickname(String name, boolean ignoreCase)
Creates an immutable list of all members matching the given nickname.default List<Member>
getElementsByUsername(String name)
Creates an immutable list of all members matching the given username.List<Member>
getElementsByUsername(String name, boolean ignoreCase)
Creates an immutable list of all members matching the given username.List<Member>
getElementsWithRoles(Collection<Role> roles)
Creates an immutable list of all members that hold all of the provided roles.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.api.utils.cache.CacheView
acceptStream, applyStream, asList, asSet, collect, forEachUnordered, getElementsByName, getElementsByName, isEmpty, lockedIterator, parallelStream, size, stream
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
getElementsById
@Nonnull List<Member> getElementsById(long id)
Retrieves all member represented by the provided ID.- Parameters:
id
- The ID of the members- Returns:
- Possibly-empty unmodifiable list of member for the specified ID
-
getElementsById
@Nonnull default List<Member> getElementsById(@Nonnull String id)
Retrieves all member represented by the provided ID.- Parameters:
id
- The ID of the members- Returns:
- Possibly-empty unmodifiable list of member for the specified ID
- Throws:
NumberFormatException
- If the provided String isnull
or cannot be resolved to an unsigned long id
-
getElementsByUsername
@Nonnull List<Member> getElementsByUsername(@Nonnull 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:
IllegalArgumentException
- If the provided name isnull
-
getElementsByUsername
@Nonnull default List<Member> getElementsByUsername(@Nonnull 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:
IllegalArgumentException
- If the provided name isnull
-
getElementsByNickname
@Nonnull List<Member> getElementsByNickname(@Nullable 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
@Nonnull default List<Member> getElementsByNickname(@Nullable 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
@Nonnull List<Member> getElementsWithRoles(@Nonnull 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:
IllegalArgumentException
- If provided withnull
-
getElementsWithRoles
@Nonnull List<Member> getElementsWithRoles(@Nonnull 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:
IllegalArgumentException
- If provided withnull
-
-