From 0b4b9307b674f7b8cf4e96ca3b06ba55fea4ae53 Mon Sep 17 00:00:00 2001 From: Tobias Kiecker <57002366+TobiasKiecker@users.noreply.github.com> Date: Thu, 23 May 2024 09:45:17 +0200 Subject: [PATCH] Fix TEXT-234 continued to implement changes to Javadoc as mentioned in: https://github.com/apache/commons-text/pull/546 --- .../commons/text/TextStringBuilder.java | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/apache/commons/text/TextStringBuilder.java b/src/main/java/org/apache/commons/text/TextStringBuilder.java index 98d546d052..b858f90153 100644 --- a/src/main/java/org/apache/commons/text/TextStringBuilder.java +++ b/src/main/java/org/apache/commons/text/TextStringBuilder.java @@ -350,7 +350,9 @@ public static TextStringBuilder wrap(final char[] initialBuffer, final int lengt /** Internal data storage. */ private char[] buffer; - /** The new line. */ + /** + * The new line, {@code null} means use the system default from {@link System#lineSeparator()}. + */ private String newLine; /** The null text. */ @@ -1162,13 +1164,18 @@ public TextStringBuilder appendln(final TextStringBuilder str, final int startIn } /** - * Appends the new line string to this string builder. + * Appends this builder's new line string to this builder. + *

+ * By default, the new line is the system default from {@link System#lineSeparator()}. + *

*

- * The new line string can be altered using {@link #setNewLineText(String)}. This might be used to force the output - * to always use UNIX line endings even when on Windows. + * The new line string can be changed using {@link #setNewLineText(String)}. For example, you can use this to force the output to always use UNIX line + * endings even when on Windows. *

* - * @return this, to enable chaining + * @return this + * @see #getNewLineText() + * @see #setNewLineText(String) */ public TextStringBuilder appendNewLine() { if (newLine == null) { @@ -2021,9 +2028,9 @@ public void getChars(final int startIndex, final int endIndex, final char[] targ } /** - * Gets the text to be appended when a new line is added. + * Gets the text to be appended when a {@link #appendNewLine() new line} is added. * - * @return The new line text, null means use system default + * @return The new line text, {@code null} means use the system default from {@link System#lineSeparator()}. */ public String getNewLineText() { return newLine; @@ -3014,10 +3021,10 @@ public TextStringBuilder setLength(final int length) { } /** - * Sets the text to be appended when a new line is added. + * Sets the text to be appended when {@link #appendNewLine() new line} is called. * - * @param newLine the new line text, null means use system default - * @return this, to enable chaining + * @param newLine the new line text, {@code null} means use the system default from {@link System#lineSeparator()}. + * @return this. */ public TextStringBuilder setNewLineText(final String newLine) { this.newLine = newLine;