add CsvReaderSettings
Preparation to add more complex CSV parsing rules.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user