return rawCollect(Collectors.toMap(keyMapper, valMapper, mergeFunction, TreeMap::new));
return rawCollect(Collectors.toMap(keyMapper, valMapper, mergeFunction, HashMap::new));
return rawCollect(Collectors.toMap(keyMapper, valMapper, mergeFunction, TreeMap::new));
/** * Returns a {@link String} which is the concatenation of the results * of calling {@link String#valueOf(Object)} on each element of this stream * in encounter order. * * <p> * This is a <a href="package-summary.html#StreamOps">terminal</a> * operation. * * @return the result of concatenation. For empty input stream empty String * is returned. */ public String joining() { return map(String::valueOf).rawCollect(Collectors.joining()); }
/** * Returns a {@link String} which is the concatenation of the results * of calling {@link String#valueOf(Object)} on each element of this stream, * separated by the specified delimiter, in encounter order. * * <p> * This is a <a href="package-summary.html#StreamOps">terminal</a> * operation. * * @param delimiter the delimiter to be used between each element * @return the result of concatenation. For empty input stream empty String * is returned. */ public String joining(CharSequence delimiter) { return map(String::valueOf).rawCollect(Collectors.joining(delimiter)); }
/** * Returns a {@link String} which is the concatenation of the results * of calling {@link String#valueOf(Object)} on each element of this stream, * separated by the specified delimiter, with the specified prefix and * suffix in encounter order. * * <p> * This is a <a href="package-summary.html#StreamOps">terminal</a> * operation. * * @param delimiter the delimiter to be used between each element * @param prefix the sequence of characters to be used at the beginning of * the joined result * @param suffix the sequence of characters to be used at the end of the * joined result * @return the result of concatenation. For empty input stream * {@code prefix + suffix} is returned. */ public String joining(CharSequence delimiter, CharSequence prefix, CharSequence suffix) { return map(String::valueOf).rawCollect(Collectors.joining(delimiter, prefix, suffix)); }
Collector<? super T, ?, D> downstream) { if (isParallel() && downstream.characteristics().contains(Characteristics.UNORDERED)) return rawCollect(Collectors.groupingByConcurrent(classifier, downstream)); return rawCollect(Collectors.groupingBy(classifier, downstream));
if (isParallel() && downstream.characteristics().contains(Characteristics.UNORDERED) && mapFactory.get() instanceof ConcurrentMap) return (M) rawCollect(Collectors.groupingByConcurrent(classifier, (Supplier<ConcurrentMap<K, D>>) mapFactory, downstream)); return rawCollect(Collectors.groupingBy(classifier, mapFactory, downstream));