A list of objects, converting them to {@code Strings} by passing them to {@link
Formatter#format(Object)}.

@throws IllegalArgumentException if any of the list elements are null or empty strings.
13778
@NonNull public <T> CharSequence join(@NonNull Iterable<T> items,
      @Nullable Formatter<T> formatter) {
    checkNotNullOrEmpty(items);
    return joinIterableWithSize(items, getSize(items), formatter);
  }
447499
public String format(String key,
                         Object[] objects) {
        if (traceNLS != null) {
            return traceNLS.getFormattedMessage(key,
                                                objects,
                                                defaultMessage);
        } else {
            return objectsToString(key, objects);
        }
    }
702055
private static String formatListToString(final List<String> list)
	{
		int lineLength = 0;
		final StringBuffer sb = new StringBuffer();
		for (final String str : list)
		{
			final int length = str.length();
			lineLength = length + lineLength;
			sb.append(str);
			sb.append(", ");
			if (100 < lineLength)
			{
				sb.append("\n");
				lineLength = 0;
			}
		}
		return sb.toString().trim();
	}
499739
public static void print(String format, Object... args) {

        Object[] stringArgs = new Object[args.length];
        for (int i = 0; i < args.length; i++) {
            stringArgs[i] = ObjectUtils.toString(args[i]);
        }
        print(String.format(format, stringArgs));
    }
538432
protected static List<String> formatMessageParameters(Object[] parameters) {
        List<String> stringParameters = new ArrayList<>(parameters.length);
        for (Object parameter : parameters) {
            stringParameters.add((parameter != null) ? parameter.toString() : null);
        }
        return stringParameters;
    }
1044742
public static String[] objectListToStringArray(final List<?> objectList) {
		if( objectList == null ) {
			return null;
		}
		
		final String[] stringArray = new String[objectList.size()];
		for( int i = 0; i < objectList.size(); i++ ) {
			stringArray[i] = objectList.get(i) != null ? objectList.get(i).toString() : null;
		}
		
		return stringArray;
	}
933841
public static StringBuilder toStringBuilder(Collection<? extends Object> collection, String delimiter) {
        StringBuilder sb = new StringBuilder(collection.size() * 20);
        for (Iterator<? extends Object> it = collection.iterator(); it.hasNext();) {
            Object cs = it.next();
            sb.append(cs);
            if (it.hasNext()) {
                sb.append(delimiter);
            }
        }
        return sb;
    }
295954
public static void listToString (StringBuilder buf, Object val, Formatter formatter)
    {
        // get an iterator if this is a collection
        if (val instanceof Iterable<?>) {
            val = ((Iterable<?>)val).iterator();
        }

        String openBox = formatter.getOpenBox();
        String closeBox = formatter.getCloseBox();

        if (val instanceof Object[]) {
            buf.append(openBox);
            Object[] v = (Object[])val;
            for (int i = 0; i < v.length; i++) {
                if (i > 0) {
                    buf.append(", ");
                }
                buf.append(formatter.toString(v[i]));
            }
            buf.append(closeBox);

        } else if (val instanceof Iterator<?>) {
            buf.append(openBox);
            Iterator<?> iter = (Iterator<?>)val;
            for (int i = 0; iter.hasNext(); i++) {
                if (i > 0) {
                    buf.append(", ");
                }
                buf.append(formatter.toString(iter.next()));
            }
            buf.append(closeBox);

        } else if (val instanceof Enumeration<?>) {
            buf.append(openBox);
            Enumeration<?> enm = (Enumeration<?>)val;
            for (int i = 0; enm.hasMoreElements(); i++) {
                if (i > 0) {
                    buf.append(", ");
                }
                buf.append(formatter.toString(enm.nextElement()));
            }
            buf.append(closeBox);

        } else {
            // fall back on the general purpose
            toString(buf, val);
        }
    }
705637
public String serializeConditionList(List<Condition> list) {
        ObjectMapper om = getObjectMapper();
        try {
            return om.writeValueAsString(new ListWrappers.ConditionList(list));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
592574
public String convertListToString(Object listOrString) {

		if (listOrString == null) {
			return null;
		}

		if (listOrString instanceof Collection) {
			List<String> list = (List<String>) listOrString;

			return StringUtils.join(list, ",");

		}

		return listOrString.toString();

	}
843384
String format(final String message, final Object[] arguments) {
		StringBuilder builder = new StringBuilder(INITIAL_STRING_BUFFER_CAPACITY);

		int argumentIndex = 0;
		int start = 0;
		int openingCurlyBrackets = 0;

		for (int index = 0; index < message.length(); ++index) {
			char character = message.charAt(index);
			if (character == '{') {
				if (openingCurlyBrackets++ == 0 && start < index) {
					builder.append(message, start, index);
					start = index;
				}
			} else if (character == '}' && openingCurlyBrackets > 0) {
				if (--openingCurlyBrackets == 0) {
					if (argumentIndex < arguments.length) {
						Object argument = arguments[argumentIndex++];
						if (argument instanceof Supplier) {
							argument = ((Supplier<?>) argument).get();
						}

						if (index == start + 1) {
							builder.append(argument);
						} else {
							builder.append(format(message.substring(start + 1, index), argument));
						}
					} else {
						builder.append(message, start, index + 1);
					}

					start = index + 1;
				}
			}
		}

		if (start < message.length()) {
			builder.append(message, start, message.length());
		}

		return builder.toString();
	}
221642
public static <T> List<T> emptyListIfNull(final List<T> list) {
		return list == null ? (List<T>) Collections.EMPTY_LIST : list;
	}
54344
public static String convertToString(Collection<? extends Object> parameters) {
        if (parameters == null || parameters.isEmpty())
            return "";

        StringBuilder result = new StringBuilder();
        for (Object param : parameters) {
            if (param instanceof String)
                param = "'" + param + "'";
            if (result.length() != 0)
                result.append(",");
            result.append(param);
        }

        log.debug("restriction list converted to {}", result);

        return result.toString();
    }
500970
@Override
    public List<String> getStringList( final String    key,
                                       final String    delim )
    {
        return formatStringList( key, getFormattedPropValue( key ), delim );
    }
450711
protected <T extends AstNode> void printList(List<T> items,
                                                 StringBuilder sb) {
        int max = items.size();
        int count = 0;
        for (AstNode item : items) {
            sb.append(item.toSource(0));
            if (count++ < max-1) {
                sb.append(", ");
            } else if (item instanceof EmptyExpression) {
                sb.append(",");
            }
        }
    }
449389
String format(final Object obj) {
		if (obj instanceof Date) {
			return format((Date) obj);
		} else if (obj instanceof Calendar) {
			return format((Calendar) obj);
		} else if (obj instanceof Long) {
			return format(((Long) obj).longValue());
		} else {
			throw new IllegalArgumentException("Unknown class: " + (obj == null ? "<null>" : obj.getClass().getName()));
		}
	}
52610
public void format(MessageArgs args, StringBuilder buf) {
    this.args = args;
    this.buf = buf;
    this.reset();
    format(streams[0], null);
  }