From 09cf3739df3b82b23bf508b4f98e999ee5b8d3c7 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 27 Mar 2017 12:13:09 -0700 Subject: [PATCH] Fluent formatting. --- .../org/apache/commons/csv/CSVFormat.java | 38 +++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/apache/commons/csv/CSVFormat.java b/src/main/java/org/apache/commons/csv/CSVFormat.java index 3d3e7e5e..a0382a37 100644 --- a/src/main/java/org/apache/commons/csv/CSVFormat.java +++ b/src/main/java/org/apache/commons/csv/CSVFormat.java @@ -263,7 +263,11 @@ public final class CSVFormat implements Serializable { * * @see Predefined#Excel */ - public static final CSVFormat EXCEL = DEFAULT.withIgnoreEmptyLines(false).withAllowMissingColumnNames(); + // @formatter:off + public static final CSVFormat EXCEL = DEFAULT + .withIgnoreEmptyLines(false) + .withAllowMissingColumnNames(); + // @formatter:on /** * Default Informix CSV UNLOAD format used by the {@code UNLOAD TO file_name} operation. @@ -289,8 +293,13 @@ public final class CSVFormat implements Serializable { * http://www.ibm.com/support/knowledgecenter/SSBJG3_2.5.0/com.ibm.gen_busug.doc/c_fgl_InOutSql_UNLOAD.htm * @since 1.3 */ - public static final CSVFormat INFORMIX_UNLOAD = DEFAULT.withDelimiter(PIPE).withEscape(BACKSLASH) - .withQuote(DOUBLE_QUOTE_CHAR).withRecordSeparator(LF); + // @formatter:off + public static final CSVFormat INFORMIX_UNLOAD = DEFAULT + .withDelimiter(PIPE) + .withEscape(BACKSLASH) + .withQuote(DOUBLE_QUOTE_CHAR) + .withRecordSeparator(LF); + // @formatter:on /** * Default Informix CSV UNLOAD format used by the {@code UNLOAD TO file_name} operation (escaping is disabled.) @@ -315,8 +324,12 @@ public final class CSVFormat implements Serializable { * http://www.ibm.com/support/knowledgecenter/SSBJG3_2.5.0/com.ibm.gen_busug.doc/c_fgl_InOutSql_UNLOAD.htm * @since 1.3 */ - public static final CSVFormat INFORMIX_UNLOAD_CSV = DEFAULT.withDelimiter(COMMA).withQuote(DOUBLE_QUOTE_CHAR) + // @formatter:off + public static final CSVFormat INFORMIX_UNLOAD_CSV = DEFAULT + .withDelimiter(COMMA) + .withQuote(DOUBLE_QUOTE_CHAR) .withRecordSeparator(LF); + // @formatter:on /** * Default MySQL format used by the {@code SELECT INTO OUTFILE} and {@code LOAD DATA INFILE} operations. @@ -342,8 +355,15 @@ public final class CSVFormat implements Serializable { * @see http://dev.mysql.com/doc/refman/5.1/en/load * -data.html */ - public static final CSVFormat MYSQL = DEFAULT.withDelimiter(TAB).withEscape(BACKSLASH).withIgnoreEmptyLines(false) - .withQuote(null).withRecordSeparator(LF).withNullString("\\N"); + // @formatter:off + public static final CSVFormat MYSQL = DEFAULT + .withDelimiter(TAB) + .withEscape(BACKSLASH) + .withIgnoreEmptyLines(false) + .withQuote(null) + .withRecordSeparator(LF) + .withNullString("\\N"); + // @formatter:off /** * Comma separated format as defined by RFC 4180. @@ -379,7 +399,11 @@ public final class CSVFormat implements Serializable { * * @see Predefined#TDF */ - public static final CSVFormat TDF = DEFAULT.withDelimiter(TAB).withIgnoreSurroundingSpaces(); + // @formatter:off + public static final CSVFormat TDF = DEFAULT + .withDelimiter(TAB) + .withIgnoreSurroundingSpaces(); + // @formatter:on /** * Returns true if the given character is a line break character.