@@ -0,0 +1,2230 @@
+package io.lettuce.core.codec;%0A%0Aimport java.nio.ByteBuffer;%0A%0A/*%0A * Copyright 2011-2019 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A/**%0A * A %7B@link RedisCodecAdapter%7D combines different codecs to encode/decode key and value%0A * to the command output.%0A * %0A * @author Dimitris Mandalidis%0A */%0Apublic final class RedisCodecAdapter %7B%0A%0A    private RedisCodecAdapter() %7B%7D%0A%0A    /**%0A     * Returns new %7B@link RedisCodec%7D%0A     * @param %3CK%3E the type of the key%0A     * @param %3CV%3E the type of the value%0A     * @param keyCodec the codec to encode/decode the keys%0A     * @param valueCodec the codec to encode/decode the values%0A     * @return%0A     */%0A    public static %3CK, V%3E RedisCodec%3CK, V%3E of(RedisCodec%3CK, ?%3E keyCodec, RedisCodec%3C?, V%3E valueCodec) %7B%0A        return new RedisCodecWrapper%3CK, V%3E(keyCodec, valueCodec);%0A    %7D%0A    %0A    private static class RedisCodecWrapper%3CK, V%3E implements RedisCodec%3CK, V%3E %7B%0A        private final RedisCodec%3CK, ?%3E keyCodec;%0A        private final RedisCodec%3C?, V%3E valueCodec;%0A        %0A        RedisCodecWrapper(RedisCodec%3CK, ?%3E keyCodec, RedisCodec%3C?, V%3E valueCodec) %7B%0A            this.keyCodec = keyCodec;%0A            this.valueCodec = valueCodec;%0A        %7D%0A%0A        @Override%0A        public K decodeKey(ByteBuffer bytes) %7B%0A            return keyCodec.decodeKey(bytes);%0A        %7D%0A%0A        @Override%0A        public V decodeValue(ByteBuffer bytes) %7B%0A            return valueCodec.decodeValue(bytes);%0A        %7D%0A%0A        @Override%0A        public ByteBuffer encodeKey(K key) %7B%0A            return keyCodec.encodeKey(key);%0A        %7D%0A%0A        @Override%0A        public ByteBuffer encodeValue(V value) %7B%0A            return valueCodec.encodeValue(value);%0A        %7D%0A    %7D%0A%7D%0A

Implement codec adapter #1122