SerializerConfig extends MapConfig { public Optional<String> getSerdeFactoryClass(String name) { return Optional.ofNullable(get(String.format(SERDE_FACTORY_CLASS, name), null)); } SerializerConfig(Config config); static String getPredefinedSerdeFactoryName(String serdeName); Optional<String> getSerdeFactoryClass(String name); List<String> getSerdeNames(); static final Logger LOGGER; static final String SERIALIZER_PREFIX; static final String SERDE_FACTORY_CLASS; static final String SERIALIZED_INSTANCE_SUFFIX; static final String SERDE_SERIALIZED_INSTANCE; }
@Test public void testGetSerdeFactoryClass() { String serdeClassName = "my.class.serde.name"; Config config = new MapConfig( ImmutableMap.of(String.format(SerializerConfig.SERDE_FACTORY_CLASS, SERDE_NAME), serdeClassName)); assertEquals(serdeClassName, new SerializerConfig(config).getSerdeFactoryClass(SERDE_NAME).get()); assertFalse(new SerializerConfig(config).getSerdeFactoryClass("otherSerdeName").isPresent()); }