A {@link StringConcatenation} allows for efficient, indentation aware concatenation of character sequences.
In addition to the methods that are specified by the implemented interface {@link CharSequence}, there are some other public operations that allow to modify the contents of this sequence. The string representation of arbitrary objects can be appended to an instance of {@link StringConcatenation}. There are overloaded variants of {@link #append(Object,String)} that allow to pass an indentation that should be applied to each line of the appendedcontent. Each line break that is part of the new content will be replaced by the line delimiter that was configured for this {@link StringConcatenation}.
The {@link #append(Object) append}-operation ignores null
arguments. This is different to what {@link StringBuffer} or {@link StringBuilder} do and that's the reason why the {@link Appendable} interface is notfulfilled by a {@link StringConcatenation}.
The object uses an internal {@link List} of {@link String Strings} that is concatenated on demand to a completesequence. Use {@link #toString()} to get the joined version of a {@link StringConcatenation}.
{@link #equals(Object)} and {@link #hashCode()} are not specialized for a {@link StringConcatenation}, that is, the semantics are based on identity similar to what {@link StringBuffer} and {@link StringBuilder} do.
@author Sebastian Zarnekow - Initial contribution and API @since 2.3
|
|