Avoid creating an anonymous extra class
*/
package org.apache.camel.kafkaconnector.timer;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Map;
+
import org.apache.camel.Exchange;
import org.apache.camel.kafkaconnector.CamelSourceConnectorConfig;
import org.apache.camel.kafkaconnector.CamelSourceTask;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
public class CamelTimerSourceTask extends CamelSourceTask {
@Override
@@ -33,9 +33,7 @@ public class CamelTimerSourceTask extends CamelSourceTask {
}
@Override
protected Map<String, String> getDefaultConfig() {
- return new HashMap<String, String>() {{
- put(CamelSourceConnectorConfig.CAMEL_SOURCE_COMPONENT_CONF, "timer");
- }};
+ return Collections.singletonMap(CamelSourceConnectorConfig.CAMEL_SOURCE_COMPONENT_CONF, "timer");
}
//XXX: this method override is the only difference from how the class was initially generated by camel-kafka-connector-generator-maven-plugin
