public class InstantSerializer extends java.lang.Object implements org.apache.kafka.common.serialization.Serializer<Instant>
Serializer
for Instant
.
This encodes the number of milliseconds since epoch using LongSerializer
.
Constructor and Description |
---|
InstantSerializer() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
configure(java.util.Map<java.lang.String,?> configs,
boolean isKey) |
byte[] |
serialize(java.lang.String topic,
Instant instant) |
public void configure(java.util.Map<java.lang.String,?> configs, boolean isKey)
configure
in interface org.apache.kafka.common.serialization.Serializer<Instant>
public byte[] serialize(java.lang.String topic, Instant instant)
serialize
in interface org.apache.kafka.common.serialization.Serializer<Instant>
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface org.apache.kafka.common.serialization.Serializer<Instant>