add CsvReaderSettings

Preparation to add more complex CSV parsing rules.
This commit is contained in:
2019-11-30 18:32:34 +01:00
parent 08b1be5334
commit ffe5ae8652
4 changed files with 37 additions and 6 deletions

View File

@@ -0,0 +1,23 @@
package org.lucares.pdbui;
import org.lucares.utils.Preconditions;
public class CsvReaderSettings {
private final byte separator;
public CsvReaderSettings(final byte separator) {
this.separator = separator;
}
public CsvReaderSettings(final char separator) {
Preconditions.checkTrue(separator == (byte) separator,
"Only separators that fulfill separator == (byte)separator are supported. "
+ "This restriction is because the parsing algorithm skips the overhead of "
+ "translating bytes to characters.");
this.separator = (byte) separator;
}
public byte getSeparator() {
return separator;
}
}