StringJoiner (Java SE 26 & JDK 26)
-
Constructor Summary
Constructors
Constructs a
StringJoinerwith no characters in it, with noprefixorsuffix, and a copy of the supplieddelimiter.Constructs a
StringJoinerwith no characters in it using copies of the suppliedprefix,delimiterandsuffix. -
Method Summary
Adds a copy of the given
CharSequencevalue as the next element of theStringJoinervalue.intlength()Returns the length of the
Stringrepresentation of thisStringJoiner.Adds the contents of the given
StringJoinerwithout prefix and suffix as the next element if it is non-empty.Sets the sequence of characters to be used when determining the string representation of this
StringJoinerand no elements have been added yet, that is, when it is empty.toString()Returns the current value, consisting of the
prefix, the values added so far separated by thedelimiter, and thesuffix, unless no elements have been added in which case, theprefix + suffixor theemptyValuecharacters are returned.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitCreates and returns a copy of this object.
booleanIndicates whether some other object is "equal to" this one.
protected voidDeprecated, for removal: This API element is subject to removal in a future version.
Returns the runtime class of this
Object.intReturns a hash code value for this object.
final voidWakes up a single thread that is waiting on this object's monitor.
final voidWakes up all threads that are waiting on this object's monitor.
final voidCauses the current thread to wait until it is awakened, typically by being notified or interrupted.
final voidwait(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
final voidwait(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
StringJoiner
-
StringJoiner
-
-
Method Details
-
setEmptyValue
-
toString
-
add
-
merge
-
length
-