Package com.dua3.utility.text
Class RichTextJoiner
java.lang.Object
com.dua3.utility.text.RichTextJoiner
- All Implemented Interfaces:
Collector<RichText,
RichTextJoiner.AccumulationType, RichText>
public class RichTextJoiner
extends Object
implements Collector<RichText,RichTextJoiner.AccumulationType,RichText>
A Joiner for
RichText
to be used with Stream.collect(Collector)
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
A record representing an accumulation type used within a context requiring text and counter aggregation.Nested classes/interfaces inherited from interface java.util.stream.Collector
Collector.Characteristics
-
Constructor Summary
ConstructorsConstructorDescriptionRichTextJoiner
(RichText delimiter) Creates a RichTextJoiner instance with the given delimiter.RichTextJoiner
(RichText delimiter, RichText prefix, RichText suffix) Creates a RichTextJoiner instance with the given delimiter, prefix, and suffix.RichTextJoiner
(CharSequence delimiter) Creates a RichTextJoiner instance with the given delimiter.RichTextJoiner
(CharSequence delimiter, CharSequence prefix, CharSequence suffix) Creates a RichTextJoiner instance with the given delimiter, prefix, and suffix. -
Method Summary
-
Constructor Details
-
RichTextJoiner
Creates a RichTextJoiner instance with the given delimiter, prefix, and suffix.- Parameters:
delimiter
- the CharSequence used to separate the joined elementsprefix
- the CharSequence to be prepended to the joined elementssuffix
- the CharSequence to be appended to the joined elements
-
RichTextJoiner
Creates a RichTextJoiner instance with the given delimiter.- Parameters:
delimiter
- the CharSequence used to separate the joined elements
-
RichTextJoiner
Creates a RichTextJoiner instance with the given delimiter, prefix, and suffix.- Parameters:
delimiter
- the RichText used to separate the joined elementsprefix
- the RichText added before the joined elementssuffix
- the RichText added after the joined elements
-
RichTextJoiner
Creates a RichTextJoiner instance with the given delimiter.- Parameters:
delimiter
- the RichText used to separate the joined elements
-
-
Method Details
-
supplier
- Specified by:
supplier
in interfaceCollector<RichText,
RichTextJoiner.AccumulationType, RichText>
-
accumulator
- Specified by:
accumulator
in interfaceCollector<RichText,
RichTextJoiner.AccumulationType, RichText>
-
combiner
- Specified by:
combiner
in interfaceCollector<RichText,
RichTextJoiner.AccumulationType, RichText>
-
finisher
- Specified by:
finisher
in interfaceCollector<RichText,
RichTextJoiner.AccumulationType, RichText>
-
characteristics
- Specified by:
characteristics
in interfaceCollector<RichText,
RichTextJoiner.AccumulationType, RichText>
-