Skip to content

Commit a8500ed

Browse files
authored
Fix grammar and errors
The example for the String[] API was wrong, it should pass only Strings, not a String and an Instant.
1 parent f4df552 commit a8500ed

1 file changed

Lines changed: 36 additions & 24 deletions

File tree

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

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -521,30 +521,36 @@ public Builder setHeader(final String... header) {
521521
}
522522

523523
/**
524-
* Sets the header comments to the given values. The comments will be printed first, before the headers. This setting is ignored by the parser.
525-
*
524+
* Sets the header comments to the given values before the CSV data.
526525
* <p>
527-
* Use {@link Builder#setCommentMarker(char)} or {@link Builder#setCommentMarker(Character)} to set the comment marker to be used with each comment.
526+
* This setting is ignored by the parser.
528527
* </p>
529528
* <p>
530-
* If comment marker is not set (null) then none of header comments will get printed.
529+
* Comments are printed first, before headers.
531530
* </p>
531+
* <p>
532+
* Use {@link Builder#setCommentMarker(char)} or {@link Builder#setCommentMarker(Character)} to set the comment marker written at the start of
533+
* each comment line.
532534
* </p>
533-
* For an example, if you use comment marker and header comments as below
535+
* <p>
536+
* If the comment marker is not set, then the header comments are ignored.
537+
* </p>
538+
* <p>
539+
* For example:
534540
* </p>
535541
* <pre>
536-
* builder.setHeaderComments(&quot;Generated by Apache Commons CSV.&quot;, Instant.now());
537-
* builder.setCommentMarker('#');
542+
* builder.setCommentMarker('#')
543+
* .setHeaderComments("Generated by Apache Commons CSV", Instant.ofEpochMilli(0));
538544
* </pre>
539-
*<p>
540-
*you would get header lines printed something similar to below
541-
*</p>
545+
* <p>
546+
* writes:
547+
* </p>
542548
* <pre>
543549
* # Generated by Apache Commons CSV.
544-
* # 2023-08-25T11:37:51.148073200Z
550+
* # 1970-01-01T00:00:00Z
545551
* </pre>
546552
*
547-
* @param headerComments the headerComments which will be printed by the Printer before the actual CSV data.
553+
* @param headerComments the headerComments which will be printed by the Printer before the CSV data.
548554
* @return This instance.
549555
*/
550556
public Builder setHeaderComments(final Object... headerComments) {
@@ -553,30 +559,36 @@ public Builder setHeaderComments(final Object... headerComments) {
553559
}
554560

555561
/**
556-
* Sets the header comments to the given values. The comments will be printed first, before the headers. This setting is ignored by the parser.
557-
*
562+
* Sets the header comments to the given values before the CSV data.
558563
* <p>
559-
* Use {@link Builder#setCommentMarker(char)} or {@link Builder#setCommentMarker(Character)} to set the comment marker to be used with each comment.
564+
* This setting is ignored by the parser.
560565
* </p>
561566
* <p>
562-
* If comment marker is not set (null) then none of header comments will get printed.
567+
* Comments are printed first, before headers.
563568
* </p>
569+
* <p>
570+
* Use {@link Builder#setCommentMarker(char)} or {@link Builder#setCommentMarker(Character)} to set the comment marker written at the start of
571+
* each comment line.
564572
* </p>
565-
* For an example, if you use comment marker and header comments as below
573+
* <p>
574+
* If the comment marker is not set, then the header comments are ignored.
575+
* </p>
576+
* <p>
577+
* For example:
566578
* </p>
567579
* <pre>
568-
* builder.setHeaderComments(&quot;Generated by Apache Commons CSV.&quot;, Instant.now());
569-
* builder.setCommentMarker('#');
580+
* builder.setCommentMarker('#')
581+
* .setHeaderComments("Generated by Apache Commons CSV", Instant.ofEpochMilli(0).toString());
570582
* </pre>
571-
*<p>
572-
*you would get header lines printed something similar to below
573-
*</p>
583+
* <p>
584+
* writes:
585+
* </p>
574586
* <pre>
575587
* # Generated by Apache Commons CSV.
576-
* # 2023-08-25T11:37:51.148073200Z
588+
* # 1970-01-01T00:00:00Z
577589
* </pre>
578590
*
579-
* @param headerComments the headerComments which will be printed by the Printer before the actual CSV data.
591+
* @param headerComments the headerComments which will be printed by the Printer before the CSV data.
580592
* @return This instance.
581593
*/
582594
public Builder setHeaderComments(final String... headerComments) {

0 commit comments

Comments
 (0)