- java.lang.Object
-
- com.speedment.common.codegen.util.CollectorUtil
-
public final class CollectorUtil extends Object
Utility methods for collecting streams in various ways.- Since:
- 2.1
- Author:
- Per Minborg, Emil Forslund
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Collector<String,?,String>joinIfNotEmpty(String delimiter, String prefix, String suffix)Similar to theCollectors.joining(CharSequence, CharSequence, CharSequence)method except that this method surrounds the result with the specifiedprefixandsuffixeven if the stream is empty.
-
-
-
Method Detail
-
joinIfNotEmpty
public static Collector<String,?,String> joinIfNotEmpty(String delimiter, String prefix, String suffix)
Similar to theCollectors.joining(CharSequence, CharSequence, CharSequence)method except that this method surrounds the result with the specifiedprefixandsuffixeven if the stream is empty.- Parameters:
delimiter- the delimiter to separate the stringsprefix- the prefix to put before the resultsuffix- the suffix to put after the result- Returns:
- a
Collectorfor joining string elements
-
-