CSVFormat implements Serializable { public CSVFormat withNullString(final String nullString) { return new CSVFormat(delimiter, quoteChar, quotePolicy, commentStart, escape, ignoreSurroundingSpaces, ignoreEmptyLines, recordSeparator, nullString, header, skipHeaderRecord); } CSVFormat(final char delimiter, final Character quoteChar,
            final Quote quotePolicy, final Character commentStart,
            final Character escape, final boolean ignoreSurroundingSpaces,
            final boolean ignoreEmptyLines, final String recordSeparator,
            final String nullString, final String[] header, boolean skipHeaderRecord); static CSVFormat newFormat(final char delimiter); @Override boolean equals(final Object obj); String format(final Object... values); Character getCommentStart(); char getDelimiter(); Character getEscape(); String[] getHeader(); boolean getIgnoreEmptyLines(); boolean getIgnoreSurroundingSpaces(); String getNullString(); Character getQuoteChar(); Quote getQuotePolicy(); String getRecordSeparator(); boolean getSkipHeaderRecord(); @Override int hashCode(); boolean isCommentingEnabled(); boolean isEscaping(); boolean isQuoting(); CSVParser parse(final Reader in); @Override String toString(); CSVFormat withCommentStart(final char commentStart); CSVFormat withCommentStart(final Character commentStart); CSVFormat withDelimiter(final char delimiter); CSVFormat withEscape(final char escape); CSVFormat withEscape(final Character escape); CSVFormat withHeader(final String... header); CSVFormat withIgnoreEmptyLines(final boolean ignoreEmptyLines); CSVFormat withIgnoreSurroundingSpaces(final boolean ignoreSurroundingSpaces); CSVFormat withNullString(final String nullString); CSVFormat withQuoteChar(final char quoteChar); CSVFormat withQuoteChar(final Character quoteChar); CSVFormat withQuotePolicy(final Quote quotePolicy); CSVFormat withRecordSeparator(final char recordSeparator); CSVFormat withRecordSeparator(final String recordSeparator); CSVFormat withSkipHeaderRecord(final boolean skipHeaderRecord); static final CSVFormat DEFAULT; static final CSVFormat RFC4180; static final CSVFormat EXCEL; static final CSVFormat TDF; static final CSVFormat MYSQL; }
@Test public void testWithNullString() throws Exception { final CSVFormat formatWithNullString = CSVFormat.DEFAULT.withNullString("null"); assertEquals("null", formatWithNullString.getNullString()); }