redis.clients.jedis.search.aggr.Row 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.search.aggr;
import java.util.Map;
import redis.clients.jedis.util.DoublePrecision;
public class Row {
private final Map fields;
public Row(Map fields) {
this.fields = fields;
}
public boolean containsKey(String key) {
return fields.containsKey(key);
}
public Object get(String key) {
return fields.get(key);
}
public String getString(String key) {
if (!containsKey(key)) {
return "";
}
return (String) fields.get(key);
}
public long getLong(String key) {
if (!containsKey(key)) {
return 0;
}
return Long.parseLong((String) fields.get(key));
}
public double getDouble(String key) {
if (!containsKey(key)) {
return 0;
}
return DoublePrecision.parseFloatingPointNumber((String) fields.get(key));
}
@Override
public String toString() {
return String.valueOf(fields);
}
}