Interface ShardCacheView
-
Nested Class Summary
Nested classes/interfaces inherited from interface CacheView
CacheView.SimpleCacheView<T> -
Method Summary
Modifier and TypeMethodDescriptiongetElementById(int id) Retrieves the JDA instance represented by the provided shard ID.default JDAgetElementById(String id) Retrieves the JDA instance represented by the provided shard ID ornullif none of the connected shards match the provided id.Methods inherited from interface CacheView
acceptStream, applyStream, asList, asSet, collect, forEachUnordered, getElementsByName, getElementsByName, isEmpty, lockedIterator, parallelStream, size, streamMethods inherited from interface Iterable
forEach, iterator, spliterator
-
Method Details
-
getElementById
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
Retrieves the JDA instance represented by the provided shard ID ornullif 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:
NumberFormatException- If the provided String isnullor cannot be resolved to an unsigned int id
-