public static interface RedisSerializationContext.SerializationPair<T>
Modifier and Type | Method and Description |
---|---|
static <T> RedisSerializationContext.SerializationPair<T> |
fromSerializer(RedisSerializer<T> serializer)
Creates a
RedisSerializationContext.SerializationPair adapter given RedisSerializer . |
RedisElementReader<T> |
getReader() |
RedisElementWriter<T> |
getWriter() |
static <T> RedisSerializationContext.SerializationPair<T> |
just(RedisElementReader<? extends T> reader,
RedisElementWriter<? extends T> writer)
Creates a
RedisSerializationContext.SerializationPair adapter given RedisElementReader and RedisElementWriter . |
static <T> RedisSerializationContext.SerializationPair<T> |
raw()
Creates a pass through
RedisSerializationContext.SerializationPair to pass-thru ByteBuffer objects. |
default T |
read(ByteBuffer buffer)
Deserialize a
ByteBuffer into the according type. |
default ByteBuffer |
write(T element)
Serialize a
element to its ByteBuffer representation. |
static <T> RedisSerializationContext.SerializationPair<T> fromSerializer(RedisSerializer<T> serializer)
RedisSerializationContext.SerializationPair
adapter given RedisSerializer
.serializer
- must not be null.RedisSerializationContext.SerializationPair
adapter for RedisSerializer
.static <T> RedisSerializationContext.SerializationPair<T> just(RedisElementReader<? extends T> reader, RedisElementWriter<? extends T> writer)
RedisSerializationContext.SerializationPair
adapter given RedisElementReader
and RedisElementWriter
.reader
- must not be null.writer
- must not be null.RedisSerializationContext.SerializationPair
encapsulating RedisElementReader
and RedisElementWriter
.static <T> RedisSerializationContext.SerializationPair<T> raw()
RedisSerializationContext.SerializationPair
to pass-thru ByteBuffer
objects.RedisSerializationContext.SerializationPair
.RedisElementReader<T> getReader()
RedisElementReader
.default T read(ByteBuffer buffer)
ByteBuffer
into the according type.buffer
- must not be null.RedisElementWriter<T> getWriter()
RedisElementWriter
.default ByteBuffer write(T element)
element
to its ByteBuffer
representation.element
- ByteBuffer
representing element
in its binary form.Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.