mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-06 21:58:03 +08:00
fix doc
This commit is contained in:
parent
7c8881eb54
commit
dffa682b8f
@ -40,6 +40,7 @@ import java.util.stream.StreamSupport;
|
||||
* </ul>
|
||||
* 不同类型的流可以通过{@link #sequential()}或{@link #parallel()}互相转换。
|
||||
*
|
||||
* @param <T> 对象类型
|
||||
* @author VampireAchao
|
||||
* @author emptypoint
|
||||
* @author huangchengxing
|
||||
@ -270,7 +271,7 @@ public class EasyStream<T> extends AbstractEnhancedWrappedStream<T, EasyStream<T
|
||||
* @return 子类实现
|
||||
*/
|
||||
@Override
|
||||
public EasyStream<T> transform(Stream<T> stream) {
|
||||
public EasyStream<T> transform(final Stream<T> stream) {
|
||||
this.stream = stream;
|
||||
return this;
|
||||
}
|
||||
|
@ -32,6 +32,11 @@ import static java.util.Objects.requireNonNull;
|
||||
*/
|
||||
public class StreamUtil {
|
||||
|
||||
/**
|
||||
* @param array 数组
|
||||
* @param <T> 元素类型
|
||||
* @return {@link Stream}
|
||||
*/
|
||||
@SafeVarargs
|
||||
public static <T> Stream<T> of(final T... array) {
|
||||
Assert.notNull(array, "Array must be not null!");
|
||||
@ -66,8 +71,9 @@ public class StreamUtil {
|
||||
|
||||
/**
|
||||
* {@link Iterator} 转换为 {@link Stream}
|
||||
*
|
||||
* @param iterator 迭代器
|
||||
* @param <T> 集合元素类型
|
||||
* @param <T> 集合元素类型
|
||||
* @return {@link Stream}
|
||||
* @throws IllegalArgumentException 如果iterator为null,抛出该异常
|
||||
*/
|
||||
@ -77,9 +83,10 @@ public class StreamUtil {
|
||||
|
||||
/**
|
||||
* {@link Iterator} 转换为 {@link Stream}
|
||||
*
|
||||
* @param iterator 迭代器
|
||||
* @param parallel 是否并行
|
||||
* @param <T> 集合元素类型
|
||||
* @param <T> 集合元素类型
|
||||
* @return {@link Stream}
|
||||
* @throws IllegalArgumentException 如果iterator为null,抛出该异常
|
||||
*/
|
||||
|
@ -42,8 +42,8 @@ public interface TransformableWrappedStream<T, S extends TransformableWrappedStr
|
||||
final Iterable<U> other,
|
||||
final BiFunction<? super T, ? super U, ? extends R> zipper) {
|
||||
Objects.requireNonNull(zipper);
|
||||
Map<Integer, T> idxIdentityMap = mapIdx((e, idx) -> MapUtil.entry(idx, e)).collect(CollectorUtil.entryToMap());
|
||||
Map<Integer, U> idxOtherMap = EasyStream.of(other).mapIdx((e, idx) -> MapUtil.entry(idx, e)).collect(CollectorUtil.entryToMap());
|
||||
final Map<Integer, T> idxIdentityMap = mapIdx((e, idx) -> MapUtil.entry(idx, e)).collect(CollectorUtil.entryToMap());
|
||||
final Map<Integer, U> idxOtherMap = EasyStream.of(other).mapIdx((e, idx) -> MapUtil.entry(idx, e)).collect(CollectorUtil.entryToMap());
|
||||
if (idxIdentityMap.size() <= idxOtherMap.size()) {
|
||||
return EasyStream.of(idxIdentityMap.keySet(), isParallel()).map(k -> zipper.apply(idxIdentityMap.get(k), idxOtherMap.get(k)));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user