Skip to content

Commit 09cf373

Browse files
committed
Fluent formatting.
1 parent 9778244 commit 09cf373

1 file changed

Lines changed: 31 additions & 7 deletions

File tree

src/main/java/org/apache/commons/csv/CSVFormat.java

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,11 @@ public CSVFormat getFormat() {
263263
*
264264
* @see Predefined#Excel
265265
*/
266-
public static final CSVFormat EXCEL = DEFAULT.withIgnoreEmptyLines(false).withAllowMissingColumnNames();
266+
// @formatter:off
267+
public static final CSVFormat EXCEL = DEFAULT
268+
.withIgnoreEmptyLines(false)
269+
.withAllowMissingColumnNames();
270+
// @formatter:on
267271

268272
/**
269273
* Default Informix CSV UNLOAD format used by the {@code UNLOAD TO file_name} operation.
@@ -289,8 +293,13 @@ public CSVFormat getFormat() {
289293
* http://www.ibm.com/support/knowledgecenter/SSBJG3_2.5.0/com.ibm.gen_busug.doc/c_fgl_InOutSql_UNLOAD.htm</a>
290294
* @since 1.3
291295
*/
292-
public static final CSVFormat INFORMIX_UNLOAD = DEFAULT.withDelimiter(PIPE).withEscape(BACKSLASH)
293-
.withQuote(DOUBLE_QUOTE_CHAR).withRecordSeparator(LF);
296+
// @formatter:off
297+
public static final CSVFormat INFORMIX_UNLOAD = DEFAULT
298+
.withDelimiter(PIPE)
299+
.withEscape(BACKSLASH)
300+
.withQuote(DOUBLE_QUOTE_CHAR)
301+
.withRecordSeparator(LF);
302+
// @formatter:on
294303

295304
/**
296305
* Default Informix CSV UNLOAD format used by the {@code UNLOAD TO file_name} operation (escaping is disabled.)
@@ -315,8 +324,12 @@ public CSVFormat getFormat() {
315324
* http://www.ibm.com/support/knowledgecenter/SSBJG3_2.5.0/com.ibm.gen_busug.doc/c_fgl_InOutSql_UNLOAD.htm</a>
316325
* @since 1.3
317326
*/
318-
public static final CSVFormat INFORMIX_UNLOAD_CSV = DEFAULT.withDelimiter(COMMA).withQuote(DOUBLE_QUOTE_CHAR)
327+
// @formatter:off
328+
public static final CSVFormat INFORMIX_UNLOAD_CSV = DEFAULT
329+
.withDelimiter(COMMA)
330+
.withQuote(DOUBLE_QUOTE_CHAR)
319331
.withRecordSeparator(LF);
332+
// @formatter:on
320333

321334
/**
322335
* Default MySQL format used by the {@code SELECT INTO OUTFILE} and {@code LOAD DATA INFILE} operations.
@@ -342,8 +355,15 @@ public CSVFormat getFormat() {
342355
* @see <a href="http://dev.mysql.com/doc/refman/5.1/en/load-data.html"> http://dev.mysql.com/doc/refman/5.1/en/load
343356
* -data.html</a>
344357
*/
345-
public static final CSVFormat MYSQL = DEFAULT.withDelimiter(TAB).withEscape(BACKSLASH).withIgnoreEmptyLines(false)
346-
.withQuote(null).withRecordSeparator(LF).withNullString("\\N");
358+
// @formatter:off
359+
public static final CSVFormat MYSQL = DEFAULT
360+
.withDelimiter(TAB)
361+
.withEscape(BACKSLASH)
362+
.withIgnoreEmptyLines(false)
363+
.withQuote(null)
364+
.withRecordSeparator(LF)
365+
.withNullString("\\N");
366+
// @formatter:off
347367

348368
/**
349369
* Comma separated format as defined by <a href="http://tools.ietf.org/html/rfc4180">RFC 4180</a>.
@@ -379,7 +399,11 @@ public CSVFormat getFormat() {
379399
*
380400
* @see Predefined#TDF
381401
*/
382-
public static final CSVFormat TDF = DEFAULT.withDelimiter(TAB).withIgnoreSurroundingSpaces();
402+
// @formatter:off
403+
public static final CSVFormat TDF = DEFAULT
404+
.withDelimiter(TAB)
405+
.withIgnoreSurroundingSpaces();
406+
// @formatter:on
383407

384408
/**
385409
* Returns true if the given character is a line break character.

0 commit comments

Comments
 (0)