@Test public void testToCsvFieldStringWithCharacterThatNeedToBeQuoted() { String input1 = "a"; assertSame(input1, gpCSV.toCsvField(input1, true, true, true)); String input2 = "\""; assertEquals("\"\"\"\"", gpCSV.toCsvField(input2, true, true, true)); String input3 = ","; assertEquals("\",\"", gpCSV.toCsvField(input3, true, true, true)); String input4 = "\n\",sample"; assertEquals("\"\n\"\",sample\"", gpCSV.toCsvField(input4, true, 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);  }