Skip to content

Commit

Permalink
Sort methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Gregory committed May 27, 2019
1 parent 3241e0c commit dca9999
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/main/java/org/apache/commons/csv/CSVFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,12 @@ public static CSVFormat valueOf(final String format) {
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;
Expand Down Expand Up @@ -722,10 +726,6 @@ public static CSVFormat valueOf(final String format) {

private final boolean trim;

private final boolean autoFlush;

private final boolean allowDuplicateHeaderNames;

/**
* Creates a customized CSV format.
*
Expand Down Expand Up @@ -880,6 +880,10 @@ public String format(final Object... values) {
}
}

public boolean getAllowDuplicateHeaderNames() {
return allowDuplicateHeaderNames;
}

/**
* Specifies whether missing column names are allowed when parsing the header line.
*
Expand Down Expand Up @@ -1669,6 +1673,17 @@ private void validate() throws IllegalArgumentException {
}
}

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}
*
Expand Down Expand Up @@ -2257,19 +2272,4 @@ public CSVFormat withTrim(final boolean trim) {
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;
}
}

0 comments on commit dca9999

Please sign in to comment.