org.redisson.client.protocol.Decoder Java Examples

The following examples show how to use org.redisson.client.protocol.Decoder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ObjectMapDecoder.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    if (mapDecoded) {
        return codec.getMapKeyDecoder();
    }
    
    if (pos++ % 2 == 0) {
        return codec.getMapKeyDecoder();
    }
    return codec.getMapValueDecoder();
}
 
Example #2
Source File: ScoredSortedSetReplayDecoder.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    if (paramNum % 2 != 0) {
        return DoubleCodec.INSTANCE.getValueDecoder();
    }
    return null;
}
 
Example #3
Source File: ScoredSortedSetPolledObjectDecoder.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    if (paramNum == 0) {
        return StringCodec.INSTANCE.getValueDecoder();
    }
    if (paramNum == 2) {
        return DoubleCodec.INSTANCE.getValueDecoder();
    }
    return null;
}
 
Example #4
Source File: AttributesPutAllMessage.java    From redisson with Apache License 2.0 5 votes vote down vote up
public Map<String, Object> getAttrs(Decoder<?> decoder) throws IOException, ClassNotFoundException {
	if (attrs == null) {
		return null;
	}
	Map<String, Object> result = new HashMap<String, Object>();
	for (Entry<String, byte[]> entry: attrs.entrySet()) {
		result.put(entry.getKey(), toObject(decoder, entry.getValue()));
	}
    return result;
}
 
Example #5
Source File: ScoredSortedListReplayDecoder.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    if (paramNum % 2 != 0) {
        return DoubleCodec.INSTANCE.getValueDecoder();
    }
    return null;
}
 
Example #6
Source File: ScoredSortedListReplayDecoder.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    if (paramNum % 2 != 0) {
        return DoubleCodec.INSTANCE.getValueDecoder();
    }
    return null;
}
 
Example #7
Source File: AttributesPutAllMessage.java    From redisson with Apache License 2.0 5 votes vote down vote up
public Map<String, Object> getAttrs(Decoder<?> decoder) throws IOException, ClassNotFoundException {
	if (attrs == null) {
		return null;
	}
	Map<String, Object> result = new HashMap<String, Object>();
	for (Entry<String, byte[]> entry: attrs.entrySet()) {
		result.put(entry.getKey(), toObject(decoder, entry.getValue()));
	}
    return result;
}
 
Example #8
Source File: AttributeMessage.java    From redisson with Apache License 2.0 5 votes vote down vote up
protected Object toObject(Decoder<?> decoder, byte[] value) throws IOException, ClassNotFoundException {
   	if (value == null) {
   		return null;
   	}
   	
   	ByteBuf buf = Unpooled.wrappedBuffer(value);
   	try {
   	    return decoder.decode(buf, null);
       } finally {
           buf.release();
       }
}
 
Example #9
Source File: GeoDistanceMapDecoder.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    if (paramNum % 2 == 0) {
        return codec.getValueDecoder();
    }
    return DoubleCodec.INSTANCE.getValueDecoder();
}
 
Example #10
Source File: ScoredSortedListReplayDecoder.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    if (paramNum % 2 != 0) {
        return DoubleCodec.INSTANCE.getValueDecoder();
    }
    return null;
}
 
Example #11
Source File: ScoredSortedSetReplayDecoder.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    if (paramNum % 2 != 0) {
        return DoubleCodec.INSTANCE.getValueDecoder();
    }
    return null;
}
 
Example #12
Source File: ScoredSortedListReplayDecoder.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    if (paramNum % 2 != 0) {
        return DoubleCodec.INSTANCE.getValueDecoder();
    }
    return null;
}
 
Example #13
Source File: TypedJsonJacksonCodec.java    From redisson with Apache License 2.0 5 votes vote down vote up
private Decoder<Object> createDecoder(final Class<?> valueClass, final TypeReference<?> valueTypeReference) {
    return new Decoder<Object>() {
        @Override
        public Object decode(ByteBuf buf, State state) throws IOException {
            if (valueClass != null) {
                return mapObjectMapper.readValue((InputStream) new ByteBufInputStream(buf), valueClass);
            }
            if (valueTypeReference != null) {
                return mapObjectMapper.readValue((InputStream) new ByteBufInputStream(buf), valueTypeReference);
            }
            return mapObjectMapper.readValue((InputStream) new ByteBufInputStream(buf), Object.class);
        }
    };
}
 
Example #14
Source File: ScoredSortedListReplayDecoder.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    if (paramNum % 2 != 0) {
        return DoubleCodec.INSTANCE.getValueDecoder();
    }
    return null;
}
 
Example #15
Source File: LZ4Codec.java    From redisson with Apache License 2.0 4 votes vote down vote up
@Override
public Decoder<Object> getValueDecoder() {
    return decoder;
}
 
Example #16
Source File: SerializationCodec.java    From redisson with Apache License 2.0 4 votes vote down vote up
@Override
public Decoder<Object> getValueDecoder() {
    return decoder;
}
 
Example #17
Source File: MarshallingCodec.java    From redisson with Apache License 2.0 4 votes vote down vote up
@Override
public Decoder<Object> getValueDecoder() {
    return decoder;
}
 
Example #18
Source File: ObjectListReplayDecoder2.java    From redisson with Apache License 2.0 4 votes vote down vote up
public ObjectListReplayDecoder2(Decoder<Object> decoder) {
    super();
    this.decoder = decoder;
}
 
Example #19
Source File: ObjectListReplayDecoder2.java    From redisson with Apache License 2.0 4 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    return decoder;
}
 
Example #20
Source File: SetReplayDecoder.java    From redisson with Apache License 2.0 4 votes vote down vote up
public SetReplayDecoder(Decoder<Object> decoder) {
    super();
    this.decoder = decoder;
}
 
Example #21
Source File: BaseEventCodec.java    From redisson with Apache License 2.0 4 votes vote down vote up
@Override
public Decoder<Object> getMapValueDecoder() {
    throw new UnsupportedOperationException();
}
 
Example #22
Source File: MapCacheGetAllDecoder.java    From redisson with Apache License 2.0 4 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    return null;
}
 
Example #23
Source File: GeoWaveMetadataCodec.java    From geowave with Apache License 2.0 4 votes vote down vote up
@Override
public Decoder<Object> getValueDecoder() {
  return decoder;
}
 
Example #24
Source File: TypedJsonJacksonCodec.java    From redisson with Apache License 2.0 4 votes vote down vote up
@Override
public Decoder<Object> getMapValueDecoder() {
    return mapValueDecoder;
}
 
Example #25
Source File: ObjectListReplayDecoder2.java    From redisson with Apache License 2.0 4 votes vote down vote up
public ObjectListReplayDecoder2(Decoder<Object> decoder) {
    super();
    this.decoder = decoder;
}
 
Example #26
Source File: CompositeCodec.java    From redisson with Apache License 2.0 4 votes vote down vote up
@Override
public Decoder<Object> getMapValueDecoder() {
    return mapValueCodec.getMapValueDecoder();
}
 
Example #27
Source File: RedissonReactiveHashCommands.java    From redisson with Apache License 2.0 4 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    return null;
}
 
Example #28
Source File: Long2MultiDecoder.java    From redisson with Apache License 2.0 4 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    return LongCodec.INSTANCE.getValueDecoder();
}
 
Example #29
Source File: StreamInfoDecoder.java    From redisson with Apache License 2.0 4 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    return null;
}
 
Example #30
Source File: ObjectListReplayDecoder2.java    From redisson with Apache License 2.0 4 votes vote down vote up
@Override
public Decoder<Object> getDecoder(int paramNum, State state) {
    return decoder;
}