@Test public void testAppendQuotedIfWhitespace() { StringBuilder sb = new StringBuilder(); StringBuilderUtils.appendQuotedIfWhitespace(sb, "a b"); assertEquals("\"a b\"", sb.toString()); sb = new StringBuilder(); StringBuilderUtils.appendQuotedIfWhitespace(sb, "a:b"); assertEquals("a:b", sb.toString()); }
public static void appendQuotedIfWhitespace(StringBuilder b, String value) { if (value == null) { return; } boolean quote = GrammarUtil.containsWhiteSpace(value); if (quote) { b.append('"'); } appendEscapingQuotes(b, value); if (quote) { b.append('"'); } }
StringBuilderUtils { public static void appendQuotedIfWhitespace(StringBuilder b, String value) { if (value == null) { return; } boolean quote = GrammarUtil.containsWhiteSpace(value); if (quote) { b.append('"'); } appendEscapingQuotes(b, value); if (quote) { b.append('"'); } } }
StringBuilderUtils { public static void appendQuotedIfWhitespace(StringBuilder b, String value) { if (value == null) { return; } boolean quote = GrammarUtil.containsWhiteSpace(value); if (quote) { b.append('"'); } appendEscapingQuotes(b, value); if (quote) { b.append('"'); } } private  StringBuilderUtils(); }
StringBuilderUtils { public static void appendQuotedIfWhitespace(StringBuilder b, String value) { if (value == null) { return; } boolean quote = GrammarUtil.containsWhiteSpace(value); if (quote) { b.append('"'); } appendEscapingQuotes(b, value); if (quote) { b.append('"'); } } private  StringBuilderUtils(); static void appendQuotedIfNonToken(StringBuilder b, String value); static void appendQuotedIfWhitespace(StringBuilder b, String value); static void appendQuoted(StringBuilder b, String value); static void appendEscapingQuotes(StringBuilder b, String value); }
StringBuilderUtils { public static void appendQuotedIfWhitespace(StringBuilder b, String value) { if (value == null) { return; } boolean quote = GrammarUtil.containsWhiteSpace(value); if (quote) { b.append('"'); } appendEscapingQuotes(b, value); if (quote) { b.append('"'); } } private  StringBuilderUtils(); static void appendQuotedIfNonToken(StringBuilder b, String value); static void appendQuotedIfWhitespace(StringBuilder b, String value); static void appendQuoted(StringBuilder b, String value); static void appendEscapingQuotes(StringBuilder b, String value);  }