@Test public void testToCsvFieldEscapesQuotes() { String input = "{\"key\": \"value\", \"foo\": \"bar\"}"; String expected = "{\"\"key\"\": \"\"value\"\", \"\"foo\"\": \"\"bar\"\"}"; assertEquals(expected, gpCSV.toCsvField(input, false, false)); assertEquals("\"" + expected, gpCSV.toCsvField(input, true, false)); assertEquals(expected + "\"", gpCSV.toCsvField(input, false, true)); assertEquals("\"" + expected + "\"", gpCSV.toCsvField(input, true, true)); }
public String toCsvField(String s, boolean prependQuoteChar, boolean appendQuoteChar) { return toCsvField(s, prependQuoteChar, appendQuoteChar, false); }
GreenplumCSV { public String toCsvField(String s, boolean prependQuoteChar, boolean appendQuoteChar) { return toCsvField(s, prependQuoteChar, appendQuoteChar, false); } }
GreenplumCSV { public String toCsvField(String s, boolean prependQuoteChar, boolean appendQuoteChar) { return toCsvField(s, prependQuoteChar, appendQuoteChar, false); } GreenplumCSV(); }
GreenplumCSV { public String toCsvField(String s, boolean prependQuoteChar, boolean appendQuoteChar) { return toCsvField(s, prependQuoteChar, appendQuoteChar, false); } GreenplumCSV(); String getValueOfNull(); char getQuote(); Character getEscape(); String getNewline(); Character getDelimiter(); GreenplumCSV withValueOfNull(String valueOfNull); GreenplumCSV withQuoteChar(String quoteString); GreenplumCSV withQuoteChar(char quoteChar); GreenplumCSV withEscapeChar(String escapeString); GreenplumCSV withEscapeChar(char escapeChar); GreenplumCSV withNewline(String newline); GreenplumCSV withDelimiter(String delimiterString); GreenplumCSV withDelimiter(char delimiterChar); String toCsvField(String s, boolean prependQuoteChar, boolean appendQuoteChar); String toCsvField(String s,
                             boolean prependQuoteChar,
                             boolean appendQuoteChar,
                             boolean skipIfQuotingIsNotNeeded); }
GreenplumCSV { public String toCsvField(String s, boolean prependQuoteChar, boolean appendQuoteChar) { return toCsvField(s, prependQuoteChar, appendQuoteChar, false); } GreenplumCSV(); String getValueOfNull(); char getQuote(); Character getEscape(); String getNewline(); Character getDelimiter(); GreenplumCSV withValueOfNull(String valueOfNull); GreenplumCSV withQuoteChar(String quoteString); GreenplumCSV withQuoteChar(char quoteChar); GreenplumCSV withEscapeChar(String escapeString); GreenplumCSV withEscapeChar(char escapeChar); GreenplumCSV withNewline(String newline); GreenplumCSV withDelimiter(String delimiterString); GreenplumCSV withDelimiter(char delimiterChar); String toCsvField(String s, boolean prependQuoteChar, boolean appendQuoteChar); String toCsvField(String s,
                             boolean prependQuoteChar,
                             boolean appendQuoteChar,
                             boolean skipIfQuotingIsNotNeeded);  }