CSVFormat implements Serializable { @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final CSVFormat other = (CSVFormat) obj; if (delimiter != other.delimiter) { return false; } if (quotePolicy != other.quotePolicy) { return false; } if (quoteChar == null) { if (other.quoteChar != null) { return false; } } else if (!quoteChar.equals(other.quoteChar)) { return false; } if (commentStart == null) { if (other.commentStart != null) { return false; } } else if (!commentStart.equals(other.commentStart)) { return false; } if (escape == null) { if (other.escape != null) { return false; } } else if (!escape.equals(other.escape)) { return false; } if (!Arrays.equals(header, other.header)) { return false; } if (ignoreSurroundingSpaces != other.ignoreSurroundingSpaces) { return false; } if (ignoreEmptyLines != other.ignoreEmptyLines) { return false; } if (recordSeparator == null) { if (other.recordSeparator != null) { return false; } } else if (!recordSeparator.equals(other.recordSeparator)) { return false; } return true; } 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 testEquals() { final CSVFormat right = CSVFormat.DEFAULT; final CSVFormat left = copy(right); assertFalse(right.equals(null)); assertFalse(right.equals("A String Instance")); assertEquals(right, right); assertEquals(right, left); assertEquals(left, right); assertEquals(right.hashCode(), right.hashCode()); assertEquals(right.hashCode(), left.hashCode()); }