Current state: Accepted
Discussion thread: here
Voting thread: here (full history)
JIRA:
Kafka exposes serialization/deserialization classes for multiple types such as ByteArray, Double, Float etc, in 'org.apache.kafka.common.serialization' package which is part of public interface. During the task KAFKA-14491 Victoria added BooleanSerde class, It will be useful to have such class in public package.
org/apache/kafka/common/serialization package:
static public final class BooleanSerde extends WrapperSerde<Boolean> { public BooleanSerde() { super(new BooleanSerializer(), new BooleanDeserializer()); } } |
/** * A serde for {@code Boolean} type. */ static public Serde<Boolean> Boolean() { return new BooleanSerde(); } |
if (Boolean.class.isAssignableFrom(type)) { return (Serde<T>) Boolean(); } |
throw new IllegalArgumentException("Unknown class for built-in serializer. Supported types are: " + "String, Short, Integer, Long, Float, Double, ByteArray, ByteBuffer, Bytes, UUID, Boolean"); |
public class BooleanSerializer implements Serializer<Boolean> { [...] public byte[] serialize(final String topic, final Boolean data) { [...] } } |
public class BooleanDeserializer implements Deserializer<Boolean> { [...] public Boolean deserialize(final String topic, final byte[] data) { [...] } } |
I think that in that case unit-tests are sufficient, since the proposed change is a new simple feature it doesn't need system tests.