You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/05/25 01:27:35 UTC
(commons-text) branch master updated: Fix TEXT-234 (#547)
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-text.git
The following commit(s) were added to refs/heads/master by this push:
new 3b20214d Fix TEXT-234 (#547)
3b20214d is described below
commit 3b20214d09881203643239fdc709e0e27623d38b
Author: Tobias Kiecker <57...@users.noreply.github.com>
AuthorDate: Sat May 25 03:27:30 2024 +0200
Fix TEXT-234 (#547)
continued to implement changes to Javadoc as mentioned in: https://github.com/apache/commons-text/pull/546
---
.../org/apache/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 98d546d0..b858f901 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 class TextStringBuilder implements CharSequence, Appendable, Serializable
/** 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 class TextStringBuilder implements CharSequence, Appendable, Serializable
}
/**
- * Appends the new line string to this string builder.
+ * Appends this builder's new line string to this builder.
+ * <p>
+ * By default, the new line is the system default from {@link System#lineSeparator()}.
+ * </p>
* <p>
- * 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.
* </p>
*
- * @return this, to enable chaining
+ * @return this
+ * @see #getNewLineText()
+ * @see #setNewLineText(String)
*/
public TextStringBuilder appendNewLine() {
if (newLine == null) {
@@ -2021,9 +2028,9 @@ public class TextStringBuilder implements CharSequence, Appendable, Serializable
}
/**
- * 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 class TextStringBuilder implements CharSequence, Appendable, Serializable
}
/**
- * 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;