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 newRedisElementWriter
using givenRedisSerializer
.Serialize aelement
to itsByteBuffer
representation.
-
Method Details
-
write
Serialize aelement
to itsByteBuffer
representation.- Parameters:
element
- can be null.- Returns:
- the
ByteBuffer
representingelement
in its binary form.
-
from
Create newRedisElementWriter
using givenRedisSerializer
.- Parameters:
serializer
- must not be null.- Returns:
- new instance of
RedisElementWriter
.
-