@Test public void testDeserializerToMapConfig() { Map<String, Object> configs = new HashMap<>(); configs.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, keyDeserializerClass); configs.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, valueDeserializerClass); Map<String, Object> newConfigs = ConsumerConfig.addDeserializerToConfig(configs, null, null); assertEquals(newConfigs.get(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG), keyDeserializerClass); assertEquals(newConfigs.get(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG), valueDeserializerClass); configs.clear(); configs.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, valueDeserializerClass); newConfigs = ConsumerConfig.addDeserializerToConfig(configs, keyDeserializer, null); assertEquals(newConfigs.get(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG), keyDeserializerClass); assertEquals(newConfigs.get(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG), valueDeserializerClass); configs.clear(); configs.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, keyDeserializerClass); newConfigs = ConsumerConfig.addDeserializerToConfig(configs, null, valueDeserializer); assertEquals(newConfigs.get(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG), keyDeserializerClass); assertEquals(newConfigs.get(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG), valueDeserializerClass); configs.clear(); newConfigs = ConsumerConfig.addDeserializerToConfig(configs, keyDeserializer, valueDeserializer); assertEquals(newConfigs.get(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG), keyDeserializerClass); assertEquals(newConfigs.get(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG), valueDeserializerClass); }
public static Map<String, Object> addDeserializerToConfig(Map<String, Object> configs, Deserializer<?> keyDeserializer, Deserializer<?> valueDeserializer) { Map<String, Object> newConfigs = new HashMap<String, Object>(); newConfigs.putAll(configs); if (keyDeserializer != null) newConfigs.put(KEY_DESERIALIZER_CLASS_CONFIG, keyDeserializer.getClass()); if (valueDeserializer != null) newConfigs.put(VALUE_DESERIALIZER_CLASS_CONFIG, valueDeserializer.getClass()); return newConfigs; }
ConsumerConfig extends AbstractConfig { public static Map<String, Object> addDeserializerToConfig(Map<String, Object> configs, Deserializer<?> keyDeserializer, Deserializer<?> valueDeserializer) { Map<String, Object> newConfigs = new HashMap<String, Object>(); newConfigs.putAll(configs); if (keyDeserializer != null) newConfigs.put(KEY_DESERIALIZER_CLASS_CONFIG, keyDeserializer.getClass()); if (valueDeserializer != null) newConfigs.put(VALUE_DESERIALIZER_CLASS_CONFIG, valueDeserializer.getClass()); return newConfigs; } }
ConsumerConfig extends AbstractConfig { public static Map<String, Object> addDeserializerToConfig(Map<String, Object> configs, Deserializer<?> keyDeserializer, Deserializer<?> valueDeserializer) { Map<String, Object> newConfigs = new HashMap<String, Object>(); newConfigs.putAll(configs); if (keyDeserializer != null) newConfigs.put(KEY_DESERIALIZER_CLASS_CONFIG, keyDeserializer.getClass()); if (valueDeserializer != null) newConfigs.put(VALUE_DESERIALIZER_CLASS_CONFIG, valueDeserializer.getClass()); return newConfigs; } ConsumerConfig(Map<?, ?> props);   ConsumerConfig(Map<?, ?> props, boolean doLog); }
ConsumerConfig extends AbstractConfig { public static Map<String, Object> addDeserializerToConfig(Map<String, Object> configs, Deserializer<?> keyDeserializer, Deserializer<?> valueDeserializer) { Map<String, Object> newConfigs = new HashMap<String, Object>(); newConfigs.putAll(configs); if (keyDeserializer != null) newConfigs.put(KEY_DESERIALIZER_CLASS_CONFIG, keyDeserializer.getClass()); if (valueDeserializer != null) newConfigs.put(VALUE_DESERIALIZER_CLASS_CONFIG, valueDeserializer.getClass()); return newConfigs; } ConsumerConfig(Map<?, ?> props);   ConsumerConfig(Map<?, ?> props, boolean doLog); static Map<String, Object> addDeserializerToConfig(Map<String, Object> configs,
                                                              Deserializer<?> keyDeserializer,
                                                              Deserializer<?> valueDeserializer); static Properties addDeserializerToConfig(Properties properties,
                                                     Deserializer<?> keyDeserializer,
                                                     Deserializer<?> valueDeserializer); static Set<String> configNames(); static void main(String[] args); }
ConsumerConfig extends AbstractConfig { public static Map<String, Object> addDeserializerToConfig(Map<String, Object> configs, Deserializer<?> keyDeserializer, Deserializer<?> valueDeserializer) { Map<String, Object> newConfigs = new HashMap<String, Object>(); newConfigs.putAll(configs); if (keyDeserializer != null) newConfigs.put(KEY_DESERIALIZER_CLASS_CONFIG, keyDeserializer.getClass()); if (valueDeserializer != null) newConfigs.put(VALUE_DESERIALIZER_CLASS_CONFIG, valueDeserializer.getClass()); return newConfigs; } ConsumerConfig(Map<?, ?> props);   ConsumerConfig(Map<?, ?> props, boolean doLog); static Map<String, Object> addDeserializerToConfig(Map<String, Object> configs,
                                                              Deserializer<?> keyDeserializer,
                                                              Deserializer<?> valueDeserializer); static Properties addDeserializerToConfig(Properties properties,
                                                     Deserializer<?> keyDeserializer,
                                                     Deserializer<?> valueDeserializer); static Set<String> configNames(); static void main(String[] args); static final String GROUP_ID_CONFIG; static final String MAX_POLL_RECORDS_CONFIG; static final String MAX_POLL_INTERVAL_MS_CONFIG; static final String SESSION_TIMEOUT_MS_CONFIG; static final String HEARTBEAT_INTERVAL_MS_CONFIG; static final String BOOTSTRAP_SERVERS_CONFIG; static final String ENABLE_AUTO_COMMIT_CONFIG; static final String AUTO_COMMIT_INTERVAL_MS_CONFIG; static final String PARTITION_ASSIGNMENT_STRATEGY_CONFIG; static final String AUTO_OFFSET_RESET_CONFIG; static final String AUTO_OFFSET_RESET_DOC; static final String FETCH_MIN_BYTES_CONFIG; static final String FETCH_MAX_BYTES_CONFIG; static final int DEFAULT_FETCH_MAX_BYTES; static final String FETCH_MAX_WAIT_MS_CONFIG; static final String METADATA_MAX_AGE_CONFIG; static final String MAX_PARTITION_FETCH_BYTES_CONFIG; static final int DEFAULT_MAX_PARTITION_FETCH_BYTES; static final String SEND_BUFFER_CONFIG; static final String RECEIVE_BUFFER_CONFIG; static final String CLIENT_ID_CONFIG; static final String RECONNECT_BACKOFF_MS_CONFIG; static final String RECONNECT_BACKOFF_MAX_MS_CONFIG; static final String RETRY_BACKOFF_MS_CONFIG; static final String METRICS_SAMPLE_WINDOW_MS_CONFIG; static final String METRICS_NUM_SAMPLES_CONFIG; static final String METRICS_RECORDING_LEVEL_CONFIG; static final String METRIC_REPORTER_CLASSES_CONFIG; static final String CHECK_CRCS_CONFIG; static final String KEY_DESERIALIZER_CLASS_CONFIG; static final String KEY_DESERIALIZER_CLASS_DOC; static final String VALUE_DESERIALIZER_CLASS_CONFIG; static final String VALUE_DESERIALIZER_CLASS_DOC; static final String CONNECTIONS_MAX_IDLE_MS_CONFIG; static final String REQUEST_TIMEOUT_MS_CONFIG; static final String INTERCEPTOR_CLASSES_CONFIG; static final String INTERCEPTOR_CLASSES_DOC; static final String EXCLUDE_INTERNAL_TOPICS_CONFIG; static final boolean DEFAULT_EXCLUDE_INTERNAL_TOPICS; static final String ISOLATION_LEVEL_CONFIG; static final String ISOLATION_LEVEL_DOC; static final String DEFAULT_ISOLATION_LEVEL; }