Interface ShardCacheView

All Superinterfaces:
CacheView<JDA>, Iterable<JDA>

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.
See Also:
  • Method Details

    • getElementById

      @Nullable 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

      @Nullable default JDA getElementById(@Nonnull String id)
      Retrieves the JDA instance represented by the provided shard ID or null 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:
      NumberFormatException - If the provided String is null or cannot be resolved to an unsigned int id