
io.redisearch.client.util.ClientUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jredisearch Show documentation
Show all versions of jredisearch Show documentation
Official client for Redis Search
The newest version!
package io.redisearch.client.util;
import java.util.HashMap;
import java.util.Map;
public class ClientUtil {
public static Map toStringMap(Map input) {
Map output = new HashMap<>(input.size());
for (Map.Entry entry : input.entrySet()) {
String key = entry.getKey();
Object obj = entry.getValue();
String str;
if (obj instanceof redis.clients.jedis.GeoCoordinate) {
redis.clients.jedis.GeoCoordinate geo = (redis.clients.jedis.GeoCoordinate) obj;
str = geo.getLongitude() + "," + geo.getLatitude();
} else if (obj instanceof String) {
str = (String) obj;
} else {
str = obj.toString();
}
output.put(key, str);
}
return output;
}
private ClientUtil() {
throw new InstantiationError("Must not instantiate this class");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy