@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || ! (obj instanceof OutputSerialization)) { return false; } final OutputSerialization other = (OutputSerialization) obj; if (other.getCsv() == null ^ this.getCsv() == null) return false; if (other.getCsv() != null && !other.getCsv().equals(this.getCsv())) return false; if (other.getJson() == null ^ this.getJson() == null) return false; if (other.getJson() != null && !other.getJson().equals(this.getJson())) return false; return true; }
private static void addOutputSerializationIfNotNull(XmlWriter xml, OutputSerialization outputSerialization) { if (outputSerialization != null) { xml.start("OutputSerialization"); if (outputSerialization.getCsv() != null) { xml.start("CSV"); CSVOutput csvOutput = outputSerialization.getCsv(); addIfNotNull(xml, "QuoteFields", csvOutput.getQuoteFields()); addIfNotNull(xml, "QuoteEscapeCharacter", csvOutput.getQuoteEscapeCharacterAsString()); addIfNotNull(xml, "RecordDelimiter", csvOutput.getRecordDelimiterAsString()); addIfNotNull(xml, "FieldDelimiter", csvOutput.getFieldDelimiterAsString()); addIfNotNull(xml, "QuoteCharacter", csvOutput.getQuoteCharacterAsString()); xml.end(); } if (outputSerialization.getJson() != null) { xml.start("JSON"); JSONOutput jsonOutput = outputSerialization.getJson(); addIfNotNull(xml, "RecordDelimiter", jsonOutput.getRecordDelimiterAsString()); xml.end(); } xml.end(); } }