Java Utililty Methods List Join

List of utility methods to do List Join

Description

The list of methods to do List Join are organized into topic(s).

Method

Stringjoin(List objs, String delim)
join
if (objs == null)
    return "";
return join(objs, delim, 0, objs.size());
Stringjoin(List target, String splite)
join
String rs = "";
StringBuilder ret = new StringBuilder();
for (T t : target) {
    ret.append(t).append(splite);
if (ret.lastIndexOf(",") > 0) {
    rs = ret.substring(0, ret.lastIndexOf(","));
return rs;
Stringjoin(List tokens, String delimiter)
join
return join(tokens, delimiter, 0, tokens.size());
Stringjoin(List values, String separator)
join
StringBuilder result = new StringBuilder();
for (Object value : values) {
    String v = value.toString().trim();
    if (hasLength(v)) {
        if (result.length() > 0) {
            result.append(separator);
        result.append(v);
...
Listjoin(List... lists)
join
List<T> result = new ArrayList<T>();
for (List<T> list : lists) {
    result.addAll(list);
return result;
Listjoin(List... ls)
join
int size = 0;
for (List<T> l : ls) {
    size += l.size();
ArrayList<T> joint = new ArrayList<T>(size);
for (List<T> l : ls) {
    joint.addAll(l);
return unmodifiableList(joint);
Listjoin(List... elements)
join
List<X> list = new ArrayList<X>();
for (List<X> element : elements) {
    list.addAll(element);
return list;
Stringjoin(String _delimiter, List _strings)
Combines the Strings in _string using _delimiter.
if (_strings == null) {
    return null;
if (_delimiter == null) {
    _delimiter = "";
StringBuilder sb = new StringBuilder();
for (int i = 0; i < _strings.size(); i++) {
...
Stringjoin(String delimiter, List strings)
join
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < strings.size(); i++) {
    String part = strings.get(i);
    if (i != 0)
        stringBuilder.append(delimiter);
    stringBuilder.append(part);
return stringBuilder.toString();
...
Stringjoin(String joiner, List joinees)
Joins the strings in joinees , separated by joiner .
if (joinees.isEmpty()) {
    return "";
} else {
    StringBuilder joined = new StringBuilder();
    joined.append(joinees.get(0));
    for (String s : joinees.subList(1, joinees.size())) {
        joined.append(joiner);
        joined.append(s);
...