io.apicurio.registry.serde.AbstractSerde Maven / Gradle / Ivy
package io.apicurio.registry.serde;
import org.apache.kafka.common.serialization.Deserializer;
import org.apache.kafka.common.serialization.Serde;
import org.apache.kafka.common.serialization.Serializer;
import java.util.Map;
public abstract class AbstractSerde implements Serde {
final private Serializer serializer;
final private Deserializer deserializer;
protected AbstractSerde(Serializer serializer, Deserializer deserializer) {
this.serializer = serializer;
this.deserializer = deserializer;
}
@Override
public void configure(Map configs, boolean isKey) {
serializer.configure(configs, isKey);
deserializer.configure(configs, isKey);
}
@Override
public void close() {
serializer.close();
deserializer.close();
}
@Override
public Serializer serializer() {
return serializer;
}
@Override
public Deserializer deserializer() {
return deserializer;
}
}