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 thisShardInfoobject in array representation: [index, count]static ShardInfocreate(int index, int count)booleanequals(Object o)Stringformat()Return a string form of thisShardInfousing the following pattern:index,countintgetCount()Return the shard count represented by thisShardInfo.intgetIndex()Return the shard index represented by thisShardInfo.inthashCode()StringtoString()
-
-
-
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 thisShardInfoobject in array representation: [index, count]- Returns:
- an array with 2 elements,
indexandcount
-
format
public String format()
Return a string form of thisShardInfousing the following pattern:index,count- Returns:
- a formatted string representing this object
-
-