redis.clients.jedis.resps.ClusterShardInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jedis_preview Show documentation
Show all versions of jedis_preview Show documentation
Jedis is a blazingly small and sane Redis java client.
The newest version!
package redis.clients.jedis.resps;
import java.util.List;
import java.util.Map;
/**
* This class holds information about a shard of the cluster with command {@code CLUSTER SHARDS}.
* They can be accessed via getters. There is also {@link ClusterShardInfo#getClusterShardInfo()}
* method that returns a generic {@link Map} in case more info are returned from the server.
*/
public class ClusterShardInfo {
public static final String SLOTS = "slots";
public static final String NODES = "nodes";
private final List> slots;
private final List nodes;
private final Map clusterShardInfo;
/**
* @param map contains key-value pairs with cluster shard info
*/
@SuppressWarnings("unchecked")
public ClusterShardInfo(Map map) {
slots = (List>) map.get(SLOTS);
nodes = (List) map.get(NODES);
clusterShardInfo = map;
}
public List> getSlots() {
return slots;
}
public List getNodes() {
return nodes;
}
public Map getClusterShardInfo() {
return clusterShardInfo;
}
}