@@ -521,28 +521,75 @@ public Builder setHeader(final String... header) {
521521 }
522522
523523 /**
524- * Sets the header comments set 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.
525+ * <p>
526+ * This setting is ignored by the parser.
527+ * </p>
528+ * <p>
529+ * Comments are printed first, before headers.
530+ * </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.
534+ * </p>
535+ * <p>
536+ * If the comment marker is not set, then the header comments are ignored.
537+ * </p>
538+ * <p>
539+ * For example:
540+ * </p>
541+ * <pre>
542+ * builder.setCommentMarker('#')
543+ * .setHeaderComments("Generated by Apache Commons CSV", Instant.ofEpochMilli(0));
544+ * </pre>
545+ * <p>
546+ * writes:
547+ * </p>
526548 * <pre>
527- * builder.setHeaderComments("Generated by Apache Commons CSV.", Instant.now());
549+ * # Generated by Apache Commons CSV.
550+ * # 1970-01-01T00:00:00Z
528551 * </pre>
529552 *
530- * @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.
531554 * @return This instance.
532555 */
556+
533557 public Builder setHeaderComments (final Object ... headerComments ) {
534558 this .headerComments = CSVFormat .clone (toStringArray (headerComments ));
535559 return this ;
536560 }
537561
538562 /**
539- * Sets the header comments set to the given values. The comments will be printed first, before the headers. This setting is ignored by the parser.
540- *
563+ * Sets the header comments to the given values before the CSV data.
564+ * <p>
565+ * This setting is ignored by the parser.
566+ * </p>
567+ * <p>
568+ * Comments are printed first, before headers.
569+ * </p>
570+ * <p>
571+ * Use {@link Builder#setCommentMarker(char)} or {@link Builder#setCommentMarker(Character)} to set the comment marker written at the start of
572+ * each comment line.
573+ * </p>
574+ * <p>
575+ * If the comment marker is not set, then the header comments are ignored.
576+ * </p>
577+ * <p>
578+ * For example:
579+ * </p>
580+ * <pre>
581+ * builder.setCommentMarker('#')
582+ * .setHeaderComments("Generated by Apache Commons CSV", Instant.ofEpochMilli(0).toString());
583+ * </pre>
584+ * <p>
585+ * writes:
586+ * </p>
541587 * <pre>
542- * Builder.setHeaderComments("Generated by Apache Commons CSV.", Instant.now());
588+ * # Generated by Apache Commons CSV.
589+ * # 1970-01-01T00:00:00Z
543590 * </pre>
544591 *
545- * @param headerComments the headerComments which will be printed by the Printer before the actual CSV data.
592+ * @param headerComments the headerComments which will be printed by the Printer before the CSV data.
546593 * @return This instance.
547594 */
548595 public Builder setHeaderComments (final String ... headerComments ) {
0 commit comments