Skip to content

Commit ff6a042

Browse files
committed
Added support for setting separator from string.
Flux cannot set option values of type char. This commit adds a setSeparator method which uses the first character of a string as separator. If the string is empty, then then separator is reset to its default value.
1 parent fe22c5a commit ff6a042

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/org/culturegraph/mf/stream/converter/RecordReader.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ public final class RecordReader extends
5151
private char separator = DEFAULT_SEPARATOR;
5252
private boolean skipEmptyRecords = true;
5353

54+
public void setSeparator(final String separator) {
55+
if (separator.length() >= 1) {
56+
this.separator = separator.charAt(0);
57+
} else {
58+
this.separator = DEFAULT_SEPARATOR;
59+
}
60+
}
61+
5462
public void setSeparator(final char separator) {
5563
this.separator = separator;
5664
}

0 commit comments

Comments
 (0)