Package discord4j.gateway
Class ShardInfo
- java.lang.Object
-
- discord4j.gateway.ShardInfo
-
public class ShardInfo extends Object
A container to express a shard index and count.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]
asArray()
Return thisShardInfo
object in array representation: [index, count]static ShardInfo
create(int index, int count)
boolean
equals(Object o)
String
format()
Return a string form of thisShardInfo
using the following pattern:index,count
int
getCount()
Return the shard count represented by thisShardInfo
.int
getIndex()
Return the shard index represented by thisShardInfo
.int
hashCode()
String
toString()
-
-
-
Method Detail
-
create
public static ShardInfo create(int index, int count)
-
getIndex
public int getIndex()
Return the shard index represented by thisShardInfo
.- Returns:
- the shard number (0-based)
-
getCount
public int getCount()
Return the shard count represented by thisShardInfo
.- Returns:
- the number of shards
-
asArray
public int[] asArray()
Return thisShardInfo
object in array representation: [index, count]- Returns:
- an array with 2 elements,
index
andcount
-
format
public String format()
Return a string form of thisShardInfo
using the following pattern:index,count
- Returns:
- a formatted string representing this object
-
-