/** * Appends a string buffer followed by a new line to this string builder. * Appending null will call {@link #appendNull()}. * * @param str the string buffer to append * @return this, to enable chaining * @since 2.3 */ public StrBuilder appendln(final StringBuffer str) { return append(str).appendNewLine(); }
/** * Appends a boolean value followed by a new line to the string builder. * * @param value the value to append * @return this, to enable chaining * @since 2.3 */ public StrBuilder appendln(final boolean value) { return append(value).appendNewLine(); }
@Override public StrBuilder appendNewLine() { count[1]++; return super.appendNewLine(); } };
@Override public StrBuilder appendNewLine() { count[1]++; return super.appendNewLine(); } };
@Override public StrBuilder appendNewLine() { count[1]++; return super.appendNewLine(); } };
/** * Appends a string followed by a new line to this string builder. * Appending null will call {@link #appendNull()}. * * @param str the string to append * @return this, to enable chaining * @since 2.3 */ public StrBuilder appendln(final String str) { return append(str).appendNewLine(); }
/** * Calls {@link String#format(String, Object...)} and appends the result. * * @param format the format string * @param objs the objects to use in the format string * @return {@code this} to enable chaining * @see String#format(String, Object...) * @since 3.2 */ public StrBuilder appendln(final String format, final Object... objs) { return append(format, objs).appendNewLine(); }
/** * Appends a double value followed by a new line to the string builder using <code>String.valueOf</code>. * * @param value the value to append * @return this, to enable chaining * @since 2.3 */ public StrBuilder appendln(final double value) { return append(value).appendNewLine(); }
@Override public StrBuilder appendNewLine() { count[1]++; return super.appendNewLine(); } };
/** * Appends another string builder followed by a new line to this string builder. * Appending null will call {@link #appendNull()}. * * @param str the string builder to append * @return this, to enable chaining * @since 2.3 */ public StrBuilder appendln(final StrBuilder str) { return append(str).appendNewLine(); }
/** * Appends an int value followed by a new line to the string builder using <code>String.valueOf</code>. * * @param value the value to append * @return this, to enable chaining * @since 2.3 */ public StrBuilder appendln(final int value) { return append(value).appendNewLine(); }
@Override public StrBuilder appendNewLine() { count[1]++; return super.appendNewLine(); } };
@Override public StrBuilder appendNewLine() { count[1]++; return super.appendNewLine(); } };
@Override public StrBuilder appendNewLine() { count[1]++; return super.appendNewLine(); } };
/** * Appends a string builder followed by a new line to this string builder. * Appending null will call {@link #appendNull()}. * * @param str the string builder to append * @return this, to enable chaining * @since 3.2 */ public StrBuilder appendln(final StringBuilder str) { return append(str).appendNewLine(); }
/** * Appends a char value followed by a new line to the string builder. * * @param ch the value to append * @return this, to enable chaining * @since 2.3 */ public StrBuilder appendln(final char ch) { return append(ch).appendNewLine(); }
@Override public StrBuilder appendNewLine() { count[1]++; return super.appendNewLine(); } };
@Override public StrBuilder appendNewLine() { count[1]++; return super.appendNewLine(); } };
@Override public StrBuilder appendNewLine() { count[1]++; return super.appendNewLine(); } };
@Test public void testAppendNewLine() { StrBuilder sb = new StrBuilder("---"); sb.appendNewLine().append("+++"); assertEquals("---" + SEP + "+++", sb.toString()); sb = new StrBuilder("---"); sb.setNewLineText("#").appendNewLine().setNewLineText(null).appendNewLine(); assertEquals("---#" + SEP, sb.toString()); }