Interface RedisElementWriter<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Strategy interface that specifies a serializer that can serialize an element to its binary representation to be used
as Redis protocol payload.
- Since:
- 2.0
- Author:
- Mark Paluch, Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> RedisElementWriter<T>from(RedisSerializer<T> serializer) Create newRedisElementWriterusing givenRedisSerializer.Serialize aelementto itsByteBufferrepresentation.
-
Method Details
-
write
Serialize aelementto itsByteBufferrepresentation.- Parameters:
element- can be null.- Returns:
- the
ByteBufferrepresentingelementin its binary form.
-
from
Create newRedisElementWriterusing givenRedisSerializer.- Parameters:
serializer- must not be null.- Returns:
- new instance of
RedisElementWriter.
-