Package org.apache.commons.lang3
Class AppendableJoiner.Builder<T>
- java.lang.Object
-
- org.apache.commons.lang3.AppendableJoiner.Builder<T>
-
- Type Parameters:
T- the type of elements to join.
- All Implemented Interfaces:
java.util.function.Supplier<AppendableJoiner<T>>
- Enclosing class:
- AppendableJoiner<T>
public static final class AppendableJoiner.Builder<T> extends java.lang.Object implements java.util.function.Supplier<AppendableJoiner<T>>
Builds instances ofAppendableJoiner.
-
-
Field Summary
Fields Modifier and Type Field Description private FailableBiConsumer<java.lang.Appendable,T,java.io.IOException>appenderThe consumer used to render each element of typeTonto anAppendable.private java.lang.CharSequencedelimiterThe delimiter that separates each element.private java.lang.CharSequenceprefixThe sequence of characters to be used at the beginning.private java.lang.CharSequencesuffixThe sequence of characters to be used at the end.
-
Constructor Summary
Constructors Constructor Description Builder()Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AppendableJoiner<T>get()Gets a new instance ofAppendableJoiner.AppendableJoiner.Builder<T>setDelimiter(java.lang.CharSequence delimiter)Sets the delimiter that separates each element.AppendableJoiner.Builder<T>setElementAppender(FailableBiConsumer<java.lang.Appendable,T,java.io.IOException> appender)Sets the consumer used to render each element of typeTonto anAppendable.AppendableJoiner.Builder<T>setPrefix(java.lang.CharSequence prefix)Sets the sequence of characters to be used at the beginning.AppendableJoiner.Builder<T>setSuffix(java.lang.CharSequence suffix)Sets the sequence of characters to be used at the end.
-
-
-
Field Detail
-
prefix
private java.lang.CharSequence prefix
The sequence of characters to be used at the beginning.
-
suffix
private java.lang.CharSequence suffix
The sequence of characters to be used at the end.
-
delimiter
private java.lang.CharSequence delimiter
The delimiter that separates each element.
-
appender
private FailableBiConsumer<java.lang.Appendable,T,java.io.IOException> appender
The consumer used to render each element of typeTonto anAppendable.
-
-
Method Detail
-
get
public AppendableJoiner<T> get()
Gets a new instance ofAppendableJoiner.- Specified by:
getin interfacejava.util.function.Supplier<T>
-
setDelimiter
public AppendableJoiner.Builder<T> setDelimiter(java.lang.CharSequence delimiter)
Sets the delimiter that separates each element.- Parameters:
delimiter- The delimiter that separates each element.- Returns:
thisinstance.
-
setElementAppender
public AppendableJoiner.Builder<T> setElementAppender(FailableBiConsumer<java.lang.Appendable,T,java.io.IOException> appender)
Sets the consumer used to render each element of typeTonto anAppendable.- Parameters:
appender- The consumer used to render each element of typeTonto anAppendable.- Returns:
thisinstance.
-
setPrefix
public AppendableJoiner.Builder<T> setPrefix(java.lang.CharSequence prefix)
Sets the sequence of characters to be used at the beginning.- Parameters:
prefix- The sequence of characters to be used at the beginning.- Returns:
thisinstance.
-
setSuffix
public AppendableJoiner.Builder<T> setSuffix(java.lang.CharSequence suffix)
Sets the sequence of characters to be used at the end.- Parameters:
suffix- The sequence of characters to be used at the end.- Returns:
thisinstance.
-
-