@@ -148,7 +148,7 @@ public final class CSVFormat implements Serializable {
148148
149149 private final char delimiter ;
150150 private final Character quoteChar ; // null if quoting is disabled
151- private final Quote quotePolicy ;
151+ private final QuoteMode quoteMode ;
152152 private final Character commentStart ; // null if commenting is disabled
153153 private final Character escape ; // null if escaping is disabled
154154 private final boolean ignoreSurroundingSpaces ; // Should leading/trailing spaces be ignored around values?
@@ -313,8 +313,8 @@ public static CSVFormat newFormat(final char delimiter) {
313313 * the char used for value separation, must not be a line break character
314314 * @param quoteChar
315315 * the Character used as value encapsulation marker, may be {@code null} to disable
316- * @param quotePolicy
317- * the quote policy
316+ * @param quoteMode
317+ * the quote mode
318318 * @param commentStart
319319 * the Character used for comment identification, may be {@code null} to disable
320320 * @param escape
@@ -334,7 +334,7 @@ public static CSVFormat newFormat(final char delimiter) {
334334 * @throws IllegalArgumentException if the delimiter is a line break character
335335 */
336336 private CSVFormat (final char delimiter , final Character quoteChar ,
337- final Quote quotePolicy , final Character commentStart ,
337+ final QuoteMode quoteMode , final Character commentStart ,
338338 final Character escape , final boolean ignoreSurroundingSpaces ,
339339 final boolean ignoreEmptyLines , final String recordSeparator ,
340340 final String nullString , final String [] header , final boolean skipHeaderRecord ,
@@ -344,7 +344,7 @@ private CSVFormat(final char delimiter, final Character quoteChar,
344344 }
345345 this .delimiter = delimiter ;
346346 this .quoteChar = quoteChar ;
347- this .quotePolicy = quotePolicy ;
347+ this .quoteMode = quoteMode ;
348348 this .commentStart = commentStart ;
349349 this .escape = escape ;
350350 this .ignoreSurroundingSpaces = ignoreSurroundingSpaces ;
@@ -384,7 +384,7 @@ public boolean equals(final Object obj) {
384384 if (delimiter != other .delimiter ) {
385385 return false ;
386386 }
387- if (quotePolicy != other .quotePolicy ) {
387+ if (quoteMode != other .quoteMode ) {
388388 return false ;
389389 }
390390 if (quoteChar == null ) {
@@ -552,8 +552,8 @@ public Character getQuoteChar() {
552552 *
553553 * @return the quote policy
554554 */
555- public Quote getQuotePolicy () {
556- return quotePolicy ;
555+ public QuoteMode getQuoteMode () {
556+ return quoteMode ;
557557 }
558558
559559 /**
@@ -581,7 +581,7 @@ public int hashCode()
581581 int result = 1 ;
582582
583583 result = prime * result + delimiter ;
584- result = prime * result + ((quotePolicy == null ) ? 0 : quotePolicy .hashCode ());
584+ result = prime * result + ((quoteMode == null ) ? 0 : quoteMode .hashCode ());
585585 result = prime * result + ((quoteChar == null ) ? 0 : quoteChar .hashCode ());
586586 result = prime * result + ((commentStart == null ) ? 0 : commentStart .hashCode ());
587587 result = prime * result + ((escape == null ) ? 0 : escape .hashCode ());
@@ -735,7 +735,7 @@ private void validate() throws IllegalArgumentException {
735735 "The comment start and the escape character cannot be the same ('" + commentStart + "')" );
736736 }
737737
738- if (escape == null && quotePolicy == Quote .NONE ) {
738+ if (escape == null && quoteMode == QuoteMode .NONE ) {
739739 throw new IllegalArgumentException ("No quotes mode set but no escape character is set" );
740740 }
741741 }
@@ -770,7 +770,7 @@ public CSVFormat withCommentMarker(final Character commentMarker) {
770770 if (isLineBreak (commentMarker )) {
771771 throw new IllegalArgumentException ("The comment start marker character cannot be a line break" );
772772 }
773- return new CSVFormat (delimiter , quoteChar , quotePolicy , commentMarker , escape ,
773+ return new CSVFormat (delimiter , quoteChar , quoteMode , commentMarker , escape ,
774774 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
775775 allowMissingColumnNames );
776776 }
@@ -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 , quoteChar , quotePolicy , commentStart , escape ,
791+ return new CSVFormat (delimiter , quoteChar , quoteMode , commentStart , escape ,
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 , quoteChar , quotePolicy , commentStart , escape ,
822+ return new CSVFormat (delimiter , quoteChar , quoteMode , commentStart , 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 , quoteChar , quotePolicy , commentStart , escape ,
845+ return new CSVFormat (delimiter , quoteChar , quoteMode , commentStart , escape ,
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 , quoteChar , quotePolicy , commentStart , escape ,
859+ return new CSVFormat (delimiter , quoteChar , quoteMode , commentStart , escape ,
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 , quoteChar , quotePolicy , commentStart , escape ,
873+ return new CSVFormat (delimiter , quoteChar , quoteMode , commentStart , escape ,
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 , quoteChar , quotePolicy , commentStart , escape ,
887+ return new CSVFormat (delimiter , quoteChar , quoteMode , commentStart , escape ,
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 , quoteChar , quotePolicy , commentStart , escape ,
908+ return new CSVFormat (delimiter , quoteChar , quoteMode , commentStart , escape ,
909909 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
910910 allowMissingColumnNames );
911911 }
@@ -936,21 +936,21 @@ public CSVFormat withQuoteChar(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 , quotePolicy , commentStart , escape ,
939+ return new CSVFormat (delimiter , quoteChar , quoteMode , commentStart , escape ,
940940 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
941941 allowMissingColumnNames );
942942 }
943943
944944 /**
945945 * Sets the output quote policy of the format to the specified value.
946946 *
947- * @param quotePolicy
947+ * @param quoteModePolicy
948948 * the quote policy to use for output.
949949 *
950950 * @return A new CSVFormat that is equal to this but with the specified quote policy
951951 */
952- public CSVFormat withQuotePolicy (final Quote quotePolicy ) {
953- return new CSVFormat (delimiter , quoteChar , quotePolicy , commentStart , escape ,
952+ public CSVFormat withQuoteMode (final QuoteMode quoteModePolicy ) {
953+ return new CSVFormat (delimiter , quoteChar , quoteModePolicy , commentStart , escape ,
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 , quoteChar , quotePolicy , commentStart , escape ,
987+ return new CSVFormat (delimiter , quoteChar , quoteMode , commentStart , escape ,
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 , quoteChar , quotePolicy , commentStart , escape ,
1002+ return new CSVFormat (delimiter , quoteChar , quoteMode , commentStart , escape ,
10031003 ignoreSurroundingSpaces , ignoreEmptyLines , recordSeparator , nullString , header , skipHeaderRecord ,
10041004 allowMissingColumnNames );
10051005 }
0 commit comments