From 474b7f4d00387aefa7abc559034ab58ee92e62b6 Mon Sep 17 00:00:00 2001 From: Dave Moten Date: Tue, 28 May 2019 08:17:26 +1000 Subject: [PATCH] [CSV-239] Add javadoc to CSVFormat (#42) --- .../java/org/apache/commons/csv/CSVFormat.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/org/apache/commons/csv/CSVFormat.java b/src/main/java/org/apache/commons/csv/CSVFormat.java index f6d16230..1c0e2d4d 100644 --- a/src/main/java/org/apache/commons/csv/CSVFormat.java +++ b/src/main/java/org/apache/commons/csv/CSVFormat.java @@ -880,6 +880,11 @@ public final class CSVFormat implements Serializable { } } + /** + * Returns true if and only if duplicate names are allowed in the headers. + * + * @return whether duplicate header names are allowed + */ public boolean getAllowDuplicateHeaderNames() { return allowDuplicateHeaderNames; } @@ -1673,10 +1678,20 @@ public final class CSVFormat implements Serializable { } } + /** + * Returns a new {@code CSVFormat} that allows duplicate header names. + * + * @return a new {@code CSVFormat} that allows duplicate header names + */ public CSVFormat withAllowDuplicateHeaderNames() { return withAllowDuplicateHeaderNames(true); } + /** + * Returns a new {@code CSVFormat} with duplicate header names behaviour set to the given value. + * + * @return a new {@code CSVFormat} with duplicate header names behaviour set to the given value + */ public CSVFormat withAllowDuplicateHeaderNames(final boolean allowDuplicateHeaderNames) { return new CSVFormat(delimiter, quoteCharacter, quoteMode, commentMarker, escapeCharacter, ignoreSurroundingSpaces, ignoreEmptyLines, recordSeparator, nullString, headerComments, header,