Package de.xima.fc.logic.text.csv
Class CsvFormat.Builder
- java.lang.Object
 - 
- de.xima.fc.logic.text.csv.CsvFormat.Builder
 
 
- 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CsvFormat.BuilderallowDoubleQuoteEscape(boolean allowDoubleQuoteEscape)Whether to allow double quote escape.CsvFormatbuild()Builds theCsvFormatinstance.CsvFormat.BuildercellFilter(Predicate<String> cellFilter)Sets the cell filter that is applied to each cell.CsvFormat.BuildercellNormalizer(UnaryOperator<String> cellNormalizer)Sets the cell normalizer that is applied to each cell.CsvFormat.Builderdelimiter(int delimiter)Sets the character used to delimit cells.CsvFormat.Builderdelimiter(String delimiter)Sets the character used to delimit cells.CsvFormat.Builderescape(int escape)Sets the character used to escape special characters in a cell.CsvFormat.Builderescape(String escape)Sets the character used to escape special characters in a cell.CsvFormat.BuilderignoreBlankCells(boolean filterBlankCells)Sets up thecellFilterto filter out blank cells.CsvFormat.BuilderignoreEmptyCells(boolean filterEmptyCells)Sets up thecellFilterto filter out empty cells.CsvFormat.Buildernewlines(String... newlines)Sets the characters that are treated as newlines.CsvFormat.Buildernewlines(Collection<String> newlines)Sets the characters that are treated as newlines.CsvFormat.Builderquote(int quote)Sets thequoteOpenandquoteClosecharacters to the same value.CsvFormat.Builderquote(String quote)Sets thequoteOpenandquoteClosecharacters to the same value.CsvFormat.BuilderquoteClose(int quoteClose)Sets the character used to end a quoted cell.CsvFormat.BuilderquoteClose(String quoteClose)Sets the character used to end a quoted cell.CsvFormat.BuilderquoteOpen(int quoteOpen)Sets the character used to start a quoted cell.CsvFormat.BuilderquoteOpen(String quoteOpen)Sets the character used to start a quoted cell.CsvFormat.BuilderrowFilter(Predicate<List<String>> rowFilter)Sets the row filter that is applied to each row after it was split into cells.CsvFormat.BuilderrowMutator(Consumer<List<String>> rowMutator)Sets the row normalizer that is applied to each row after it was split into cells.CsvFormat.BuilderrowNormalizer(UnaryOperator<List<String>> rowNormalizer)Sets the row normalizer that is applied to each row after it was split into cells.CsvFormat.BuildertreatLineBreaksAsDelimiter(boolean treatLineBreaksAsDelimiter)When set totrue, line breaks will be treated as cell delimiters.CsvFormat.BuildertrimCells(boolean trimCells)Sets up thecellNormalizerto trim cells, i.e. 
 - 
 
- 
- 
Method Detail
- 
allowDoubleQuoteEscape
public CsvFormat.Builder allowDoubleQuoteEscape(boolean allowDoubleQuoteEscape)
Whether to allow double quote escape. If set totrue, a quote character can be escaped by repeating it.- Parameters:
 allowDoubleQuoteEscape- Whether to allow double quote escape.- Returns:
 - This builder for chaining method calls.
 
 
- 
build
public CsvFormat build()
Builds theCsvFormatinstance. Modifying the builder after calling this method has no effect on the returned instance.- Returns:
 - The 
CsvFormatinstance. 
 
- 
cellFilter
public CsvFormat.Builder cellFilter(Predicate<String> cellFilter)
Sets the cell filter that is applied to each cell. The filter is applied after the cell normalizer and may remove cells from the result.- Parameters:
 cellFilter- The cell filter.- Returns:
 - This builder for chaining method calls.
 
 
- 
cellNormalizer
public CsvFormat.Builder cellNormalizer(UnaryOperator<String> cellNormalizer)
Sets the cell normalizer that is applied to each cell. The normalizer is applied before the cell filter and may transform the cell into a different cell.- Parameters:
 cellNormalizer- The cell normalizer.- Returns:
 - This builder for chaining method calls.
 
 
- 
delimiter
public CsvFormat.Builder delimiter(int delimiter)
Sets the character used to delimit cells.- Parameters:
 delimiter- The delimiter character.- Returns:
 - This builder for chaining method calls.
 
 
- 
delimiter
public CsvFormat.Builder delimiter(String delimiter)
Sets the character used to delimit cells.- Parameters:
 delimiter- The delimiter character.- Returns:
 - This builder for chaining method calls.
 
 
- 
escape
public CsvFormat.Builder escape(int escape)
Sets the character used to escape special characters in a cell.- Parameters:
 escape- The escape character.- Returns:
 - This builder for chaining method calls.
 
 
- 
escape
public CsvFormat.Builder escape(String escape)
Sets the character used to escape special characters in a cell.- Parameters:
 escape- The escape character.- Returns:
 - This builder for chaining method calls.
 
 
- 
ignoreBlankCells
public CsvFormat.Builder ignoreBlankCells(boolean filterBlankCells)
Sets up thecellFilterto filter out blank cells.- Parameters:
 filterBlankCells- Iftrue, blank cells will be filtered out.- Returns:
 - This builder for chaining method calls.
 
 
- 
ignoreEmptyCells
public CsvFormat.Builder ignoreEmptyCells(boolean filterEmptyCells)
Sets up thecellFilterto filter out empty cells.- Parameters:
 filterEmptyCells- Iftrue, empty cells will be filtered out.- Returns:
 - This builder for chaining method calls.
 
 
- 
newlines
public CsvFormat.Builder newlines(Collection<String> newlines)
Sets the characters that are treated as newlines.- Parameters:
 newlines- The newline characters.- Returns:
 - This builder for chaining method calls.
 
 
- 
newlines
public CsvFormat.Builder newlines(String... newlines)
Sets the characters that are treated as newlines.- Parameters:
 newlines- The newline characters.- Returns:
 - This builder for chaining method calls.
 
 
- 
quote
public CsvFormat.Builder quote(String quote)
Sets thequoteOpenandquoteClosecharacters to the same value.- Parameters:
 quote- The quote character.- Returns:
 - This builder for chaining method calls.
 
 
- 
quote
public CsvFormat.Builder quote(int quote)
Sets thequoteOpenandquoteClosecharacters to the same value.- Parameters:
 quote- The quote character.- Returns:
 - This builder for chaining method calls.
 
 
- 
quoteClose
public CsvFormat.Builder quoteClose(int quoteClose)
Sets the character used to end a quoted cell.- Parameters:
 quoteClose- The quote character.- Returns:
 - This builder for chaining method calls.
 
 
- 
quoteClose
public CsvFormat.Builder quoteClose(String quoteClose)
Sets the character used to end a quoted cell.- Parameters:
 quoteClose- The quote character.- Returns:
 - This builder for chaining method calls.
 
 
- 
quoteOpen
public CsvFormat.Builder quoteOpen(int quoteOpen)
Sets the character used to start a quoted cell.- Parameters:
 quoteOpen- The quote character.- Returns:
 - This builder for chaining method calls.
 
 
- 
quoteOpen
public CsvFormat.Builder quoteOpen(String quoteOpen)
Sets the character used to start a quoted cell.- Parameters:
 quoteOpen- The quote character.- Returns:
 - This builder for chaining method calls.
 
 
- 
rowFilter
public CsvFormat.Builder rowFilter(Predicate<List<String>> rowFilter)
Sets the row filter that is applied to each row after it was split into cells. The filter is applied after the cell normalizer and may remove rows from the result.- Parameters:
 rowFilter- The row filter.- Returns:
 - This builder for chaining method calls.
 
 
- 
rowMutator
public CsvFormat.Builder rowMutator(Consumer<List<String>> rowMutator)
Sets the row normalizer that is applied to each row after it was split into cells. The normalizer is applied before the row filter and may transform the row into a different row.- Parameters:
 rowMutator- The row normalizer.- Returns:
 - This builder for chaining method calls.
 
 
- 
rowNormalizer
public CsvFormat.Builder rowNormalizer(UnaryOperator<List<String>> rowNormalizer)
Sets the row normalizer that is applied to each row after it was split into cells. The normalizer is applied before the row filter and may transform the row into a different row.- Parameters:
 rowNormalizer- The row normalizer.- Returns:
 - This builder for chaining method calls.
 
 
- 
treatLineBreaksAsDelimiter
public CsvFormat.Builder treatLineBreaksAsDelimiter(boolean treatLineBreaksAsDelimiter)
When set totrue, line breaks will be treated as cell delimiters. Useful when splitting a single row of characters separated values. Not recommended for splitting multiple rows (as it will result in a single row with all cells).- Parameters:
 treatLineBreaksAsDelimiter- Whether to treat line breaks as delimiters.- Returns:
 - This builder for chaining method calls.
 
 
- 
trimCells
public CsvFormat.Builder trimCells(boolean trimCells)
Sets up thecellNormalizerto trim cells, i.e. remove leading and trailing whitespace.- Parameters:
 trimCells- Iftrue, cells will be trimmed.- Returns:
 - This builder for chaining method calls.
 
 
 - 
 
 -