Package net.dv8tion.jda.bot.utils.cache
Interface ShardCacheView
-
- All Known Implementing Classes:
ShardCacheViewImpl
,ShardCacheViewImpl.UnifiedShardCacheViewImpl
public interface ShardCacheView extends CacheView<JDA>
Read-only view on internal ShardManager cache of JDA instances.
This can be useful to check information such as size without creating an immutable snapshot first.
-
-
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 JDA
getElementById(int id)
Retrieves the JDA instance represented by the provided shard ID.default JDA
getElementById(java.lang.String id)
Retrieves the JDA instance represented by the provided shard ID ornull
if none of the connected shards match the provided id.-
Methods inherited from interface net.dv8tion.jda.core.utils.cache.CacheView
asList, asSet, collect, getElementsByName, getElementsByName, isEmpty, parallelStream, size, stream
-
-
-
-
Method Detail
-
getElementById
JDA getElementById(int id)
Retrieves the JDA instance represented by the provided shard ID.- Parameters:
id
- The ID of the entity- Returns:
- Possibly-null entity for the specified shard ID
-
getElementById
default JDA getElementById(java.lang.String id)
Retrieves the JDA instance represented by the provided shard ID ornull
if none of the connected shards match the provided id.- Parameters:
id
- The ID of the shard- Returns:
- Possibly-null entity for the specified shard ID
- Throws:
java.lang.NumberFormatException
- If the provided String isnull
or cannot be resolved to an unsigned int id
-
-