This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-csv.git
The following commit(s) were added to refs/heads/master by this push: new dca9999 Sort methods. dca9999 is described below commit dca99998f17a9755dfb40ed30bc1734e54ba0b04 Author: Gary Gregory <gardgreg...@gmail.com> AuthorDate: Mon May 27 08:10:35 2019 -0400 Sort methods. --- .../java/org/apache/commons/csv/CSVFormat.java | 38 +++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/java/org/apache/commons/csv/CSVFormat.java b/src/main/java/org/apache/commons/csv/CSVFormat.java index f555306..f6d1623 100644 --- a/src/main/java/org/apache/commons/csv/CSVFormat.java +++ b/src/main/java/org/apache/commons/csv/CSVFormat.java @@ -688,8 +688,12 @@ public final class CSVFormat implements Serializable { return CSVFormat.Predefined.valueOf(format).getFormat(); } + private final boolean allowDuplicateHeaderNames; + private final boolean allowMissingColumnNames; + private final boolean autoFlush; + private final Character commentMarker; // null if commenting is disabled private final char delimiter; @@ -722,10 +726,6 @@ public final class CSVFormat implements Serializable { private final boolean trim; - private final boolean autoFlush; - - private final boolean allowDuplicateHeaderNames; - /** * Creates a customized CSV format. * @@ -880,6 +880,10 @@ public final class CSVFormat implements Serializable { } } + public boolean getAllowDuplicateHeaderNames() { + return allowDuplicateHeaderNames; + } + /** * Specifies whether missing column names are allowed when parsing the header line. * @@ -1669,6 +1673,17 @@ public final class CSVFormat implements Serializable { } } + public CSVFormat withAllowDuplicateHeaderNames() { + return withAllowDuplicateHeaderNames(true); + } + + public CSVFormat withAllowDuplicateHeaderNames(final boolean allowDuplicateHeaderNames) { + return new CSVFormat(delimiter, quoteCharacter, quoteMode, commentMarker, escapeCharacter, + ignoreSurroundingSpaces, ignoreEmptyLines, recordSeparator, nullString, headerComments, header, + skipHeaderRecord, allowMissingColumnNames, ignoreHeaderCase, trim, trailingDelimiter, autoFlush, + allowDuplicateHeaderNames); + } + /** * Returns a new {@code CSVFormat} with the missing column names behavior of the format set to {@code true} * @@ -2257,19 +2272,4 @@ public final class CSVFormat implements Serializable { skipHeaderRecord, allowMissingColumnNames, ignoreHeaderCase, trim, trailingDelimiter, autoFlush, allowDuplicateHeaderNames); } - - public CSVFormat withAllowDuplicateHeaderNames(final boolean allowDuplicateHeaderNames) { - return new CSVFormat(delimiter, quoteCharacter, quoteMode, commentMarker, escapeCharacter, - ignoreSurroundingSpaces, ignoreEmptyLines, recordSeparator, nullString, headerComments, header, - skipHeaderRecord, allowMissingColumnNames, ignoreHeaderCase, trim, trailingDelimiter, autoFlush, - allowDuplicateHeaderNames); - } - - public CSVFormat withAllowDuplicateHeaderNames() { - return withAllowDuplicateHeaderNames(true); - } - - public boolean getAllowDuplicateHeaderNames() { - return allowDuplicateHeaderNames; - } }