/** * Appends the string representation of each of {@code parts}, using the previously configured separator between * each, to {@code appendable}. */ public <A extends Appendable> A appendTo(A appendable, Iterable<?> parts) throws IOException { return appendTo(appendable, parts.iterator()); }
/** * Appends the string representation of each of {@code parts}, using the previously configured separator between * each, to {@code builder}. Identical to {@link #appendTo(Appendable, Iterable)}, except that it does not throw * {@link IOException}. */ public final StringBuilder appendTo(StringBuilder builder, Object[] parts) { return appendTo(builder, Arrays.asList(parts)); }
/** * Appends the string representation of each of {@code parts}, using the previously configured separator between * each, to {@code builder}. Identical to {@link #appendTo(Appendable, Iterable)}, except that it does not throw * {@link IOException}. */ public final StringBuilder appendTo(StringBuilder builder, Iterable<?> parts) { return appendTo(builder, parts.iterator()); }
/** * Appends the string representation of each of {@code parts}, using the previously configured separator between * each, to {@code appendable}. */ public final <A extends Appendable> A appendTo(A appendable, Object[] parts) throws IOException { return appendTo(appendable, Arrays.asList(parts)); }
/** * Returns a string containing the string representation of each of {@code parts}, using the previously configured * separator between each. * * @since 11.0 */ public final String join(Iterator<?> parts) { return appendTo(new StringBuilder(), parts).toString(); }
/** * Appends the string representation of each of {@code parts}, using the previously configured separator between * each, to {@code builder}. Identical to {@link #appendTo(Appendable, Iterable)}, except that it does not throw * {@link IOException}. * * @since 11.0 */ public final StringBuilder appendTo(StringBuilder builder, Iterator<?> parts) { try { appendTo((Appendable) builder, parts); } catch (IOException impossible) { throw new AssertionError(impossible); } return builder; }
/** * Appends to {@code appendable} the string representation of each of the remaining arguments. */ public final <A extends Appendable> A appendTo(A appendable, @Nullable Object first, @Nullable Object second, Object... rest) throws IOException { return appendTo(appendable, iterable(first, second, rest)); }
/** * Appends to {@code builder} the string representation of each of the remaining arguments. Identical to * {@link #appendTo(Appendable, Object, Object, Object...)}, except that it does not throw {@link IOException}. */ public final StringBuilder appendTo(StringBuilder builder, @Nullable Object first, @Nullable Object second, Object... rest) { return appendTo(builder, iterable(first, second, rest)); }