changing the comment with template to be more meaningful

This commit is contained in:
gbidsilva 2023-08-25 17:22:37 +05:30
parent 7f277bc5f2
commit 72dc36be77
1 changed files with 56 additions and 7 deletions

View File

@ -521,12 +521,46 @@ public final class CSVFormat implements Serializable {
}
/**
* Sets the header comments set to the given values. The comments will be printed first with the provided comment marker set by {@link Builder#setCommentMarker(char)}, before the headers. This setting is ignored by the parser.
*
* Gets the character marking the start of a line comment.
* <p>
* The comment format for each line is:
* </p>
* <pre>
* builder.setHeaderComments(&quot;Generated by Apache Commons CSV.&quot;, Instant.now());
* CommentMarker SPACE CommentArrayElement
* </pre>
* <p>
* For example, using a comment marker {@code '#'} and a comment array {@code comments ["line 1", "line 2"]}:
* </p>
* <pre>
* # line 1
* # line 2
* </pre>
*
* @return the comment start marker, may be {@code null}
*/
/**
* 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.
* <p>
* Use {@link Builder#setCommentMarker(char)} or {@link Builder#setCommentMarker(Character)} to set the comment marker to be used with each comment.
* </p>
* <p>
* If comment marker is not set (null) then none of header comments will get printed.
* </p>
* </p>
* For an example, if you use comment marker and header comments as below
* </p>
* <pre>
* builder.setHeaderComments(&quot;Generated by Apache Commons CSV.&quot;, Instant.now());
* builder.setCommentMarker('#');
* </pre>
*<p>
*you would get header lines printed something similar to below
*</p>
* <pre>
* # Generated by Apache Commons CSV.
* # 2023-08-25T11:37:51.148073200Z
* </pre>
* @param headerComments the headerComments which will be printed by the Printer before the actual CSV data.
* @return This instance.
*/
@ -536,12 +570,27 @@ public final class CSVFormat implements Serializable {
}
/**
* Sets the header comments set to the given values. The comments will be printed first with the provided comment marker set by {@link Builder#setCommentMarker(char)}, before the headers. This setting is ignored by the parser.
*
* 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.
* <p>
* Use {@link Builder#setCommentMarker(char)} or {@link Builder#setCommentMarker(Character)} to set the comment marker to be used with each comment.
* </p>
* <p>
* If comment marker is not set (null) then none of header comments will get printed.
* </p>
* </p>
* For an example, if you use comment marker and header comments as below
* </p>
* <pre>
* Builder.setHeaderComments(&quot;Generated by Apache Commons CSV.&quot;, Instant.now());
* builder.setHeaderComments(&quot;Generated by Apache Commons CSV.&quot;, Instant.now());
* builder.setCommentMarker('#');
* </pre>
*<p>
*you would get header lines printed something similar to below
*</p>
* <pre>
* # Generated by Apache Commons CSV.
* # 2023-08-25T11:37:51.148073200Z
* </pre>
*
* @param headerComments the headerComments which will be printed by the Printer before the actual CSV data.
* @return This instance.
*/