RedissonScoredSortedSet.getScoreAsync result fixed

pull/365/head
Nikita 9 years ago
parent 15bda71e40
commit 9daaea1102

@ -28,6 +28,7 @@ import java.util.Map.Entry;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import org.redisson.client.codec.Codec; import org.redisson.client.codec.Codec;
import org.redisson.client.codec.ScoredCodec;
import org.redisson.client.codec.StringCodec; import org.redisson.client.codec.StringCodec;
import org.redisson.client.protocol.RedisCommand; import org.redisson.client.protocol.RedisCommand;
import org.redisson.client.protocol.RedisCommands; import org.redisson.client.protocol.RedisCommands;
@ -218,7 +219,7 @@ public class RedissonScoredSortedSet<V> extends RedissonExpirable implements RSc
@Override @Override
public Future<Double> getScoreAsync(V o) { public Future<Double> getScoreAsync(V o) {
return commandExecutor.readAsync(getName(), codec, RedisCommands.ZSCORE, getName(), o); return commandExecutor.readAsync(getName(), new ScoredCodec(codec), RedisCommands.ZSCORE, getName(), o);
} }
@Override @Override

@ -26,7 +26,7 @@ import io.netty.buffer.ByteBuf;
public class ScanCodec implements Codec { public class ScanCodec implements Codec {
public Codec delegate; public final Codec delegate;
public ScanCodec(Codec delegate) { public ScanCodec(Codec delegate) {
super(); super();

@ -0,0 +1,34 @@
/**
* Copyright 2014 Nikita Koksharov, Nickolay Borbit
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.redisson.client.codec;
import org.redisson.client.protocol.Encoder;
public class ScoredCodec extends StringCodec {
public final Codec delegate;
public ScoredCodec(Codec delegate) {
super();
this.delegate = delegate;
}
@Override
public Encoder getValueEncoder() {
return delegate.getValueEncoder();
}
}
Loading…
Cancel
Save