[CSV-239] Add javadoc to CSVFormat (#42)

This commit is contained in:
Dave Moten 2019-05-28 08:17:26 +10:00 committed by Gary Gregory
parent dca99998f1
commit 474b7f4d00
1 changed files with 15 additions and 0 deletions

View File

@ -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,