Class ShardInfo

java.lang.Object
discord4j.gateway.ShardInfo

public class ShardInfo extends Object
A container to express a shard index and count.
  • Method Details

    • create

      public static ShardInfo create(int index, int count)
    • getIndex

      public int getIndex()
      Return the shard index represented by this ShardInfo.
      Returns:
      the shard number (0-based)
    • getCount

      public int getCount()
      Return the shard count represented by this ShardInfo.
      Returns:
      the number of shards
    • asArray

      public int[] asArray()
      Return this ShardInfo object in array representation: [index, count]
      Returns:
      an array with 2 elements, index and count
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • format

      public String format()
      Return a string form of this ShardInfo using the following pattern: index,count
      Returns:
      a formatted string representing this object
    • toString

      public String toString()
      Overrides:
      toString in class Object