@@ -149,7 +149,7 @@ public final class CSVFormat implements Serializable {
149149 private final char delimiter ;
150150 private final Character quoteCharacter ; // null if quoting is disabled
151151 private final QuoteMode quoteMode ;
152- private final Character commentStartCharacter ; // null if commenting is disabled
152+ private final Character commentMarker ; // null if commenting is disabled
153153 private final Character escapeCharacter ; // null if escaping is disabled
154154 private final boolean ignoreSurroundingSpaces ; // Should leading/trailing spaces be ignored around values?
155155 private final boolean allowMissingColumnNames ;
@@ -345,7 +345,7 @@ private CSVFormat(final char delimiter, final Character quoteChar,
345345 this .delimiter = delimiter ;
346346 this .quoteCharacter = quoteChar ;
347347 this .quoteMode = quoteMode ;
348- this .commentStartCharacter = commentStart ;
348+ this .commentMarker = commentStart ;
349349 this .escapeCharacter = escape ;
350350 this .ignoreSurroundingSpaces = ignoreSurroundingSpaces ;
351351 this .allowMissingColumnNames = allowMissingColumnNames ;
@@ -394,11 +394,11 @@ public boolean equals(final Object obj) {
394394 } else if (!quoteCharacter .equals (other .quoteCharacter )) {
395395 return false ;
396396 }
397- if (commentStartCharacter == null ) {
398- if (other .commentStartCharacter != null ) {
397+ if (commentMarker == null ) {
398+ if (other .commentMarker != null ) {
399399 return false ;
400400 }
401- } else if (!commentStartCharacter .equals (other .commentStartCharacter )) {
401+ } else if (!commentMarker .equals (other .commentMarker )) {
402402 return false ;
403403 }
404404 if (escapeCharacter == null ) {
@@ -460,8 +460,8 @@ public String format(final Object... values) {
460460 *
461461 * @return the comment start marker, may be {@code null}
462462 */
463- public Character getCommentStartCharacter () {
464- return commentStartCharacter ;
463+ public Character getCommentMarker () {
464+ return commentMarker ;
465465 }
466466
467467 /**
@@ -583,7 +583,7 @@ public int hashCode()
583583 result = prime * result + delimiter ;
584584 result = prime * result + ((quoteMode == null ) ? 0 : quoteMode .hashCode ());
585585 result = prime * result + ((quoteCharacter == null ) ? 0 : quoteCharacter .hashCode ());
586- result = prime * result + ((commentStartCharacter == null ) ? 0 : commentStartCharacter .hashCode ());
586+ result = prime * result + ((commentMarker == null ) ? 0 : commentMarker .hashCode ());
587587 result = prime * result + ((escapeCharacter == null ) ? 0 : escapeCharacter .hashCode ());
588588 result = prime * result + ((nullString == null ) ? 0 : nullString .hashCode ());
589589 result = prime * result + (ignoreSurroundingSpaces ? 1231 : 1237 );
@@ -601,8 +601,8 @@ public int hashCode()
601601 *
602602 * @return {@code true} is comments are supported, {@code false} otherwise
603603 */
604- public boolean isCommentStartCharacterSet () {
605- return commentStartCharacter != null ;
604+ public boolean isCommentMarkerSet () {
605+ return commentMarker != null ;
606606 }
607607
608608 /**
@@ -678,9 +678,9 @@ public String toString() {
678678 sb .append (' ' );
679679 sb .append ("QuoteChar=<" ).append (quoteCharacter ).append ('>' );
680680 }
681- if (isCommentStartCharacterSet ()) {
681+ if (isCommentMarkerSet ()) {
682682 sb .append (' ' );
683- sb .append ("CommentStart=<" ).append (commentStartCharacter ).append ('>' );
683+ sb .append ("CommentStart=<" ).append (commentMarker ).append ('>' );
684684 }
685685 if (isNullStringSet ()) {
686686 sb .append (' ' );
@@ -720,19 +720,19 @@ private void validate() throws IllegalArgumentException {
720720 "The escape character and the delimiter cannot be the same ('" + escapeCharacter + "')" );
721721 }
722722
723- if (commentStartCharacter != null && delimiter == commentStartCharacter .charValue ()) {
723+ if (commentMarker != null && delimiter == commentMarker .charValue ()) {
724724 throw new IllegalArgumentException (
725- "The comment start character and the delimiter cannot be the same ('" + commentStartCharacter + "')" );
725+ "The comment start character and the delimiter cannot be the same ('" + commentMarker + "')" );
726726 }
727727
728- if (quoteCharacter != null && quoteCharacter .equals (commentStartCharacter )) {
728+ if (quoteCharacter != null && quoteCharacter .equals (commentMarker )) {
729729 throw new IllegalArgumentException (
730- "The comment start character and the quoteChar cannot be the same ('" + commentStartCharacter + "')" );
730+ "The comment start character and the quoteChar cannot be the same ('" + commentMarker + "')" );
731731 }
732732
733- if (escapeCharacter != null && escapeCharacter .equals (commentStartCharacter )) {
733+ if (escapeCharacter != null && escapeCharacter .equals (commentMarker )) {
734734 throw new IllegalArgumentException (
735- "The comment start and the escape character cannot be the same ('" + commentStartCharacter + "')" );
735+ "The comment start and the escape character cannot be the same ('" + commentMarker + "')" );
736736 }
737737
738738 if (escapeCharacter == null && quoteMode == QuoteMode .NONE ) {
@@ -788,7 +788,7 @@ public CSVFormat withDelimiter(final char delimiter) {
788788 if (isLineBreak (delimiter )) {
789789 throw new IllegalArgumentException ("The delimiter cannot be a line break" );
790790 }
791- return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentStartCharacter , escapeCharacter ,
791+ return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentMarker , escapeCharacter ,
792792 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
793793 allowMissingColumnNames );
794794 }
@@ -819,7 +819,7 @@ public CSVFormat withEscape(final Character escape) {
819819 if (isLineBreak (escape )) {
820820 throw new IllegalArgumentException ("The escape character cannot be a line break" );
821821 }
822- return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentStartCharacter , escape ,
822+ return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentMarker , escape ,
823823 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
824824 allowMissingColumnNames );
825825 }
@@ -842,7 +842,7 @@ public CSVFormat withEscape(final Character escape) {
842842 * @see #withSkipHeaderRecord(boolean)
843843 */
844844 public CSVFormat withHeader (final String ... header ) {
845- return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentStartCharacter , escapeCharacter ,
845+ return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentMarker , escapeCharacter ,
846846 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
847847 allowMissingColumnNames );
848848 }
@@ -856,7 +856,7 @@ public CSVFormat withHeader(final String... header) {
856856 * @return A new CSVFormat that is equal to this but with the specified missing column names behavior.
857857 */
858858 public CSVFormat withAllowMissingColumnNames (final boolean allowMissingColumnNames ) {
859- return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentStartCharacter , escapeCharacter ,
859+ return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentMarker , escapeCharacter ,
860860 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
861861 allowMissingColumnNames );
862862 }
@@ -870,7 +870,7 @@ public CSVFormat withAllowMissingColumnNames(final boolean allowMissingColumnNam
870870 * @return A new CSVFormat that is equal to this but with the specified empty line skipping behavior.
871871 */
872872 public CSVFormat withIgnoreEmptyLines (final boolean ignoreEmptyLines ) {
873- return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentStartCharacter , escapeCharacter ,
873+ return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentMarker , escapeCharacter ,
874874 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
875875 allowMissingColumnNames );
876876 }
@@ -884,7 +884,7 @@ public CSVFormat withIgnoreEmptyLines(final boolean ignoreEmptyLines) {
884884 * @return A new CSVFormat that is equal to this but with the specified trimming behavior.
885885 */
886886 public CSVFormat withIgnoreSurroundingSpaces (final boolean ignoreSurroundingSpaces ) {
887- return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentStartCharacter , escapeCharacter ,
887+ return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentMarker , escapeCharacter ,
888888 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
889889 allowMissingColumnNames );
890890 }
@@ -905,7 +905,7 @@ public CSVFormat withIgnoreSurroundingSpaces(final boolean ignoreSurroundingSpac
905905 * @return A new CSVFormat that is equal to this but with the specified null conversion string.
906906 */
907907 public CSVFormat withNullString (final String nullString ) {
908- return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentStartCharacter , escapeCharacter ,
908+ return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentMarker , escapeCharacter ,
909909 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
910910 allowMissingColumnNames );
911911 }
@@ -936,7 +936,7 @@ public CSVFormat withQuote(final Character quoteChar) {
936936 if (isLineBreak (quoteChar )) {
937937 throw new IllegalArgumentException ("The quoteChar cannot be a line break" );
938938 }
939- return new CSVFormat (delimiter , quoteChar , quoteMode , commentStartCharacter , escapeCharacter ,
939+ return new CSVFormat (delimiter , quoteChar , quoteMode , commentMarker , escapeCharacter ,
940940 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
941941 allowMissingColumnNames );
942942 }
@@ -950,7 +950,7 @@ public CSVFormat withQuote(final Character quoteChar) {
950950 * @return A new CSVFormat that is equal to this but with the specified quote policy
951951 */
952952 public CSVFormat withQuoteMode (final QuoteMode quoteModePolicy ) {
953- return new CSVFormat (delimiter , quoteCharacter , quoteModePolicy , commentStartCharacter , escapeCharacter ,
953+ return new CSVFormat (delimiter , quoteCharacter , quoteModePolicy , commentMarker , escapeCharacter ,
954954 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
955955 allowMissingColumnNames );
956956 }
@@ -984,7 +984,7 @@ public CSVFormat withRecordSeparator(final char recordSeparator) {
984984 * if recordSeparator is none of CR, LF or CRLF
985985 */
986986 public CSVFormat withRecordSeparator (final String recordSeparator ) {
987- return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentStartCharacter , escapeCharacter ,
987+ return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentMarker , escapeCharacter ,
988988 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
989989 allowMissingColumnNames );
990990 }
@@ -999,7 +999,7 @@ public CSVFormat withRecordSeparator(final String recordSeparator) {
999999 * @see #withHeader(String...)
10001000 */
10011001 public CSVFormat withSkipHeaderRecord (final boolean skipHeaderRecord ) {
1002- return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentStartCharacter , escapeCharacter ,
1002+ return new CSVFormat (delimiter , quoteCharacter , quoteMode , commentMarker , escapeCharacter ,
10031003 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
10041004 allowMissingColumnNames );
10051005 }
0 commit comments