Skip to content

Commit ac5d7ba

Browse files
committed
Add toString and fix javadoc
1 parent b893fbc commit ac5d7ba

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

bw-util-jmx/src/main/java/org/bedework/util/jmx/InfoLines.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,26 @@
2727
*/
2828
public class InfoLines extends ArrayList<String> {
2929
/** Appends newline
30-
* @param ln
30+
* @param ln line content
3131
*/
3232
public void addLn(final String ln) {
3333
add(ln + "\n");
3434
}
3535

3636
/** Emit the exception message
37-
* @param t
37+
* @param t Throwable
3838
*/
3939
public void exceptionMsg(final Throwable t) {
4040
addLn("Exception - check logs: " + t.getMessage());
4141
}
42+
43+
public String toString() {
44+
final StringBuilder sb = new StringBuilder();
45+
46+
for (final String s : this) {
47+
sb.append(s).append('\n');
48+
}
49+
50+
return sb.toString();
51+
}
4252
}

0 commit comments

Comments
 (0)