public interface RedisSerializationContext<K,V>
This context provides RedisSerializationContext.SerializationPair
s for key, value, hash-key (field), hash-value and String
serialization and deserialization.
RedisElementWriter
,
RedisElementReader
Modifier and Type | Interface and Description |
---|---|
static interface |
RedisSerializationContext.RedisSerializationContextBuilder<K,V>
Builder for
RedisSerializationContext . |
static interface |
RedisSerializationContext.SerializationPair<T>
Typed serialization tuple.
|
static <K,V> RedisSerializationContext.RedisSerializationContextBuilder<K,V> newSerializationContext()
RedisSerializationContext.RedisSerializationContextBuilder
.K
- expected key type.V
- expected value type.RedisSerializationContext.RedisSerializationContextBuilder
.static <K,V> RedisSerializationContext.RedisSerializationContextBuilder<K,V> newSerializationContext(RedisSerializer<?> defaultSerializer)
RedisSerializationContext.RedisSerializationContextBuilder
using a given default RedisSerializer
.K
- expected key type.V
- expected value type.defaultSerializer
- must not be null.RedisSerializationContext.RedisSerializationContextBuilder
.static <K,V> RedisSerializationContext.RedisSerializationContextBuilder<K,V> newSerializationContext(RedisSerializationContext.SerializationPair<?> serializationPair)
RedisSerializationContext.RedisSerializationContextBuilder
using a given default RedisSerializationContext.SerializationPair
.K
- expected key type.V
- expected value type.serializationPair
- must not be null.RedisSerializationContext.RedisSerializationContextBuilder
.@Deprecated static RedisSerializationContext<byte[],byte[]> raw()
byteArray()
instead.RedisSerializationContext
using a byte[]
serialization
pair.RedisSerializationContext
.static RedisSerializationContext<byte[],byte[]> byteArray()
RedisSerializationContext
using a byte[]
serialization.RedisSerializationContext
.static RedisSerializationContext<ByteBuffer,ByteBuffer> byteBuffer()
RedisSerializationContext
using a ByteBuffer
serialization.RedisSerializationContext
.static RedisSerializationContext<Object,Object> java()
RedisSerializationContext
using a JdkSerializationRedisSerializer
.RedisSerializationContext
.static RedisSerializationContext<Object,Object> java(ClassLoader classLoader)
RedisSerializationContext
using a JdkSerializationRedisSerializer
with given
ClassLoader
.classLoader
- the ClassLoader
to use for deserialization. Can be null.RedisSerializationContext
.static RedisSerializationContext<String,String> string()
RedisSerializationContext
using a StringRedisSerializer
.static <T> RedisSerializationContext<T,T> fromSerializer(RedisSerializer<T> serializer)
RedisSerializationContext
using the given RedisSerializer
.T
- serializer
- must not be null.static <T> RedisSerializationContext<T,T> just(RedisSerializationContext.SerializationPair<T> serializationPair)
RedisSerializationContext
using the given RedisSerializationContext.SerializationPair
.T
- serializationPair
- RedisSerializationContext.SerializationPair<K> getKeySerializationPair()
RedisSerializationContext.SerializationPair
for key-typed serialization and deserialization.RedisSerializationContext.SerializationPair<V> getValueSerializationPair()
RedisSerializationContext.SerializationPair
for value-typed serialization and deserialization.<HK> RedisSerializationContext.SerializationPair<HK> getHashKeySerializationPair()
RedisSerializationContext.SerializationPair
for hash-key-typed serialization and deserialization.<HV> RedisSerializationContext.SerializationPair<HV> getHashValueSerializationPair()
RedisSerializationContext.SerializationPair
for hash-value-typed serialization and deserialization.RedisSerializationContext.SerializationPair<String> getStringSerializationPair()
RedisSerializationContext.SerializationPair
for String
-typed serialization and deserialization.Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.