diff --git a/src/main/java/org/redisson/RedissonScoredSortedSet.java b/src/main/java/org/redisson/RedissonScoredSortedSet.java index 0641971bd..8f5a5902d 100644 --- a/src/main/java/org/redisson/RedissonScoredSortedSet.java +++ b/src/main/java/org/redisson/RedissonScoredSortedSet.java @@ -28,6 +28,7 @@ import java.util.Map.Entry; import java.util.NoSuchElementException; import org.redisson.client.codec.Codec; +import org.redisson.client.codec.ScoredCodec; import org.redisson.client.codec.StringCodec; import org.redisson.client.protocol.RedisCommand; import org.redisson.client.protocol.RedisCommands; @@ -218,7 +219,7 @@ public class RedissonScoredSortedSet extends RedissonExpirable implements RSc @Override public Future getScoreAsync(V o) { - return commandExecutor.readAsync(getName(), codec, RedisCommands.ZSCORE, getName(), o); + return commandExecutor.readAsync(getName(), new ScoredCodec(codec), RedisCommands.ZSCORE, getName(), o); } @Override diff --git a/src/main/java/org/redisson/client/codec/ScanCodec.java b/src/main/java/org/redisson/client/codec/ScanCodec.java index 4f2259f1e..f38ef9679 100644 --- a/src/main/java/org/redisson/client/codec/ScanCodec.java +++ b/src/main/java/org/redisson/client/codec/ScanCodec.java @@ -26,7 +26,7 @@ import io.netty.buffer.ByteBuf; public class ScanCodec implements Codec { - public Codec delegate; + public final Codec delegate; public ScanCodec(Codec delegate) { super(); diff --git a/src/main/java/org/redisson/client/codec/ScoredCodec.java b/src/main/java/org/redisson/client/codec/ScoredCodec.java new file mode 100644 index 000000000..12378bc2f --- /dev/null +++ b/src/main/java/org/redisson/client/codec/ScoredCodec.java @@ -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(); + } + +}