Skip to content

Commit

Permalink
refactor(filters): rellocate json packages
Browse files Browse the repository at this point in the history
  • Loading branch information
fhussonnois committed Oct 1, 2021
1 parent 499abd0 commit 2b8d260
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions connect-file-pulse-dataformat/pom.xml
Expand Up @@ -36,5 +36,9 @@
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.jsoniter</groupId>
<artifactId>jsoniter</artifactId>
</dependency>
</dependencies>
</project>
Expand Up @@ -41,7 +41,7 @@ public class DefaultJSONStructConverter implements JSONStructConverter {
/**
* Creates a new {@link DefaultJSONStructConverter} instance.
*/
public DefaultJSONStructConverter() {
DefaultJSONStructConverter() {
ACCESSORS.put(ValueType.ARRAY, new ArrayJsonFieldAccessor());
ACCESSORS.put(ValueType.STRING, new StringJsonFieldAccessor());
ACCESSORS.put(ValueType.OBJECT, new ObjectJsonFieldAccessor());
Expand Down
Expand Up @@ -26,6 +26,10 @@
*/
public interface JSONStructConverter {

static JSONStructConverter createDefault() {
return new DefaultJSONStructConverter();
}

/**
* Gets a {@link TypedStruct} instance for the specified value.
*
Expand Down
Expand Up @@ -23,7 +23,7 @@
import io.streamthoughts.kafka.connect.filepulse.data.Type;
import io.streamthoughts.kafka.connect.filepulse.data.TypedStruct;
import io.streamthoughts.kafka.connect.filepulse.data.TypedValue;
import io.streamthoughts.kafka.connect.filepulse.json.DefaultJSONStructConverter;
import io.streamthoughts.kafka.connect.filepulse.json.JSONStructConverter;
import io.streamthoughts.kafka.connect.filepulse.reader.RecordsIterable;
import org.apache.kafka.common.config.ConfigDef;

Expand All @@ -36,7 +36,7 @@

public class JSONFilter extends AbstractMergeRecordFilter<JSONFilter> {

private final DefaultJSONStructConverter converter = new DefaultJSONStructConverter();
private final JSONStructConverter converter = JSONStructConverter.createDefault();

private JSONFilterConfig configs;

Expand Down

0 comments on commit 2b8d260

Please sign in to comment.