Search in sources :

Example 1 with NestedMultiDecoder

use of org.redisson.client.protocol.decoder.NestedMultiDecoder in project redisson by redisson.

the class RedissonGeo method posAsync.

@Override
public RFuture<Map<V, GeoPosition>> posAsync(V... members) {
    List<Object> params = new ArrayList<Object>(members.length + 1);
    params.add(getName());
    params.addAll(Arrays.asList(members));
    MultiDecoder<Map<Object, Object>> decoder = new NestedMultiDecoder(new GeoPositionDecoder(), new GeoPositionMapDecoder(params), true);
    RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEOPOS", decoder, 2, ValueType.OBJECTS);
    return commandExecutor.readAsync(getName(), new ScoredCodec(codec), command, params.toArray());
}
Also used : GeoPositionMapDecoder(org.redisson.client.protocol.decoder.GeoPositionMapDecoder) ArrayList(java.util.ArrayList) RedisCommand(org.redisson.client.protocol.RedisCommand) ScoredCodec(org.redisson.client.codec.ScoredCodec) GeoPositionDecoder(org.redisson.client.protocol.decoder.GeoPositionDecoder) FlatNestedMultiDecoder(org.redisson.client.protocol.decoder.FlatNestedMultiDecoder) NestedMultiDecoder(org.redisson.client.protocol.decoder.NestedMultiDecoder) Map(java.util.Map)

Aggregations

ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 ScoredCodec (org.redisson.client.codec.ScoredCodec)1 RedisCommand (org.redisson.client.protocol.RedisCommand)1 FlatNestedMultiDecoder (org.redisson.client.protocol.decoder.FlatNestedMultiDecoder)1 GeoPositionDecoder (org.redisson.client.protocol.decoder.GeoPositionDecoder)1 GeoPositionMapDecoder (org.redisson.client.protocol.decoder.GeoPositionMapDecoder)1 NestedMultiDecoder (org.redisson.client.protocol.decoder.NestedMultiDecoder)1