@Test public void testQuoteString() { Assert.assertNull(CSVUtils.quoteString(null)); Assert.assertEquals("\"\"", CSVUtils.quoteString("")); Assert.assertEquals("\"string\"", CSVUtils.quoteString("string")); Assert.assertEquals("\"string with \"quotes\"\"", CSVUtils.quoteString("string with \"quotes\"")); }
@Contract(value = "null -> null; !null -> !null", pure = true) public static String quoteString(String value) { if (value == null) { return null; } return "\"" + value + "\""; }
CSVUtils { @Contract(value = "null -> null; !null -> !null", pure = true) public static String quoteString(String value) { if (value == null) { return null; } return "\"" + value + "\""; } }
CSVUtils { @Contract(value = "null -> null; !null -> !null", pure = true) public static String quoteString(String value) { if (value == null) { return null; } return "\"" + value + "\""; } private  CSVUtils(); }
CSVUtils { @Contract(value = "null -> null; !null -> !null", pure = true) public static String quoteString(String value) { if (value == null) { return null; } return "\"" + value + "\""; } private  CSVUtils(); @Contract("null -> null") static String getEscapedValueForCsv(String value); @Contract("null -> null; !null -> !null") static String escapeDoubleQuote(String value); @Contract(value = "null -> null; !null -> !null", pure = true) static String quoteString(String value); }
CSVUtils { @Contract(value = "null -> null; !null -> !null", pure = true) public static String quoteString(String value) { if (value == null) { return null; } return "\"" + value + "\""; } private  CSVUtils(); @Contract("null -> null") static String getEscapedValueForCsv(String value); @Contract("null -> null; !null -> !null") static String escapeDoubleQuote(String value); @Contract(value = "null -> null; !null -> !null", pure = true) static String quoteString(String value);  }