Skip to content

Commit 9797255

Browse files
committed
Sort members
1 parent 0dff1d5 commit 9797255

5 files changed

Lines changed: 2034 additions & 2034 deletions

File tree

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -271,17 +271,6 @@ public Builder setAllowDuplicateHeaderNames(final boolean allowDuplicateHeaderNa
271271
return this;
272272
}
273273

274-
/**
275-
* Sets the duplicate header names behavior.
276-
*
277-
* @param duplicateHeaderMode the duplicate header names behavior
278-
* @return This instance.
279-
*/
280-
public Builder setDuplicateHeaderMode(final DuplicateHeaderMode duplicateHeaderMode) {
281-
this.duplicateHeaderMode = duplicateHeaderMode;
282-
return this;
283-
}
284-
285274
/**
286275
* Sets the missing column names behavior, {@code true} to allow missing column names in the header line, {@code false} to cause an
287276
* {@link IllegalArgumentException} to be thrown.
@@ -361,6 +350,17 @@ public Builder setDelimiter(final String delimiter) {
361350
return this;
362351
}
363352

353+
/**
354+
* Sets the duplicate header names behavior.
355+
*
356+
* @param duplicateHeaderMode the duplicate header names behavior
357+
* @return This instance.
358+
*/
359+
public Builder setDuplicateHeaderMode(final DuplicateHeaderMode duplicateHeaderMode) {
360+
this.duplicateHeaderMode = duplicateHeaderMode;
361+
return this;
362+
}
363+
364364
/**
365365
* Sets the escape character.
366366
*
@@ -1472,16 +1472,6 @@ public boolean getAllowDuplicateHeaderNames() {
14721472
return duplicateHeaderMode == DuplicateHeaderMode.ALLOW_ALL;
14731473
}
14741474

1475-
/**
1476-
* Gets how duplicate headers are handled.
1477-
*
1478-
* @return if duplicate header values are allowed, allowed conditionally, or disallowed.
1479-
* @since 1.9.0
1480-
*/
1481-
public DuplicateHeaderMode getDuplicateHeaderMode() {
1482-
return duplicateHeaderMode;
1483-
}
1484-
14851475
/**
14861476
* Specifies whether missing column names are allowed when parsing the header line.
14871477
*
@@ -1530,6 +1520,16 @@ public String getDelimiterString() {
15301520
return delimiter;
15311521
}
15321522

1523+
/**
1524+
* Gets how duplicate headers are handled.
1525+
*
1526+
* @return if duplicate header values are allowed, allowed conditionally, or disallowed.
1527+
* @since 1.9.0
1528+
*/
1529+
public DuplicateHeaderMode getDuplicateHeaderMode() {
1530+
return duplicateHeaderMode;
1531+
}
1532+
15331533
/**
15341534
* Returns the escape character.
15351535
*

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

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,17 @@ public String getFirstEndOfLine() {
559559
return lexer.getFirstEol();
560560
}
561561

562+
/**
563+
* Returns the header comment, if any.
564+
* The header comment appears before the header record.
565+
*
566+
* @return the header comment for this stream, or null if no comment is available.
567+
* @since 1.10.0
568+
*/
569+
public String getHeaderComment() {
570+
return headerComment;
571+
}
572+
562573
/**
563574
* Returns a copy of the header map.
564575
* <p>
@@ -605,57 +616,6 @@ public List<String> getHeaderNames() {
605616
return Collections.unmodifiableList(headers.headerNames);
606617
}
607618

608-
/**
609-
* Checks whether there is a header comment.
610-
* The header comment appears before the header record.
611-
* Note that if the parser's format has been given an explicit header
612-
* (with {@link CSVFormat.Builder#setHeader(String... )} or another overload)
613-
* and the header record is not being skipped
614-
* ({@link CSVFormat.Builder#setSkipHeaderRecord} is false) then any initial comments
615-
* will be associated with the first record, not the header.
616-
*
617-
* @return true if this parser has seen a header comment, false otherwise
618-
* @since 1.10.0
619-
*/
620-
public boolean hasHeaderComment() {
621-
return headerComment != null;
622-
}
623-
624-
/**
625-
* Returns the header comment, if any.
626-
* The header comment appears before the header record.
627-
*
628-
* @return the header comment for this stream, or null if no comment is available.
629-
* @since 1.10.0
630-
*/
631-
public String getHeaderComment() {
632-
return headerComment;
633-
}
634-
635-
/**
636-
* Checks whether there is a trailer comment.
637-
* Trailer comments are located between the last record and EOF.
638-
* The trailer comments will only be available after the parser has
639-
* finished processing this stream.
640-
*
641-
* @return true if this parser has seen a trailer comment, false otherwise
642-
* @since 1.10.0
643-
*/
644-
public boolean hasTrailerComment() {
645-
return trailerComment != null;
646-
}
647-
648-
/**
649-
* Returns the trailer comment, if any.
650-
* Trailer comments are located between the last record and EOF
651-
*
652-
* @return the trailer comment for this stream, or null if no comment is available.
653-
* @since 1.10.0
654-
*/
655-
public String getTrailerComment() {
656-
return trailerComment;
657-
}
658-
659619
/**
660620
* Returns the current record number in the input stream.
661621
*
@@ -691,6 +651,17 @@ public List<CSVRecord> getRecords() throws IOException {
691651
return records;
692652
}
693653

654+
/**
655+
* Returns the trailer comment, if any.
656+
* Trailer comments are located between the last record and EOF
657+
*
658+
* @return the trailer comment for this stream, or null if no comment is available.
659+
* @since 1.10.0
660+
*/
661+
public String getTrailerComment() {
662+
return trailerComment;
663+
}
664+
694665
/**
695666
* Handle whether input is parsed as null
696667
*
@@ -710,6 +681,35 @@ private String handleNull(final String input) {
710681
return strictQuoteMode && nullString == null && input.isEmpty() && !isQuoted ? null : input;
711682
}
712683

684+
/**
685+
* Checks whether there is a header comment.
686+
* The header comment appears before the header record.
687+
* Note that if the parser's format has been given an explicit header
688+
* (with {@link CSVFormat.Builder#setHeader(String... )} or another overload)
689+
* and the header record is not being skipped
690+
* ({@link CSVFormat.Builder#setSkipHeaderRecord} is false) then any initial comments
691+
* will be associated with the first record, not the header.
692+
*
693+
* @return true if this parser has seen a header comment, false otherwise
694+
* @since 1.10.0
695+
*/
696+
public boolean hasHeaderComment() {
697+
return headerComment != null;
698+
}
699+
700+
/**
701+
* Checks whether there is a trailer comment.
702+
* Trailer comments are located between the last record and EOF.
703+
* The trailer comments will only be available after the parser has
704+
* finished processing this stream.
705+
*
706+
* @return true if this parser has seen a trailer comment, false otherwise
707+
* @since 1.10.0
708+
*/
709+
public boolean hasTrailerComment() {
710+
return trailerComment != null;
711+
}
712+
713713
/**
714714
* Tests whether this parser is closed.
715715
*

0 commit comments

Comments
 (0)