MCPcopy Create free account
hub / github.com/apache/solr / join

Method join

solr/solrj/src/java/org/apache/solr/common/util/StrUtils.java:184–198  ·  view source on GitHub ↗

Creates a backslash escaped string, joining all the items. @see #escapeTextWithSeparator

(Collection<?> items, char separator)

Source from the content-addressed store, hash-verified

182 * @see #escapeTextWithSeparator
183 */
184 public static String join(Collection<?> items, char separator) {
185 if (items == null) return "";
186 StringBuilder sb = new StringBuilder(items.size() << 3);
187 boolean first = true;
188 for (Object o : items) {
189 String item = String.valueOf(o);
190 if (first) {
191 first = false;
192 } else {
193 sb.append(separator);
194 }
195 appendEscapedTextToBuilder(sb, item, separator);
196 }
197 return sb.toString();
198 }
199
200 public static List<String> splitWS(String s, boolean decode) {
201 ArrayList<String> lst = new ArrayList<>(2);

Callers 15

testAllNodesMethod · 0.95
testSomeNodesMethod · 0.95
issueCreateJobMethod · 0.95
testMethod · 0.95
testMethod · 0.95
testMethod · 0.95
assertSyncMethod · 0.95
assertSyncMethod · 0.95
assertSyncMethod · 0.95

Calls 5

sizeMethod · 0.65
appendMethod · 0.65
toStringMethod · 0.65
valueOfMethod · 0.45

Tested by 15

testAllNodesMethod · 0.76
testSomeNodesMethod · 0.76
issueCreateJobMethod · 0.76
testMethod · 0.76
testMethod · 0.76
testMethod · 0.76
assertSyncMethod · 0.76
assertSyncMethod · 0.76
assertSyncMethod · 0.76