mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
:trollface: 去掉transform
This commit is contained in:
parent
b47b531b4c
commit
680ad52f0c
@ -263,18 +263,6 @@ public class EasyStream<T> extends AbstractEnhancedWrappedStream<T, EasyStream<T
|
|||||||
return new EasyStream<>(stream);
|
return new EasyStream<>(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 转换为子类实现
|
|
||||||
*
|
|
||||||
* @param stream 流
|
|
||||||
* @return 子类实现
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public EasyStream<T> transform(Stream<T> stream) {
|
|
||||||
this.stream = stream;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 建造者
|
* 建造者
|
||||||
*
|
*
|
||||||
|
@ -756,18 +756,6 @@ public class EntryStream<K, V> extends AbstractEnhancedWrappedStream<Map.Entry<K
|
|||||||
return new EntryStream<>(stream);
|
return new EntryStream<>(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 转换为子类实现
|
|
||||||
*
|
|
||||||
* @param stream 流
|
|
||||||
* @return 子类实现
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public EntryStream<K, V> transform(Stream<Map.Entry<K, V>> stream) {
|
|
||||||
this.stream = stream;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* key重复时直接抛出异常
|
* key重复时直接抛出异常
|
||||||
*/
|
*/
|
||||||
|
@ -269,7 +269,7 @@ public interface TransformableWrappedStream<T, S extends TransformableWrappedStr
|
|||||||
Objects.requireNonNull(action);
|
Objects.requireNonNull(action);
|
||||||
if (isParallel()) {
|
if (isParallel()) {
|
||||||
final Map<Integer, T> idxMap = easyStream().toIdxMap();
|
final Map<Integer, T> idxMap = easyStream().toIdxMap();
|
||||||
return transform(EasyStream.of(idxMap.entrySet())
|
return wrap(EasyStream.of(idxMap.entrySet())
|
||||||
.parallel(isParallel())
|
.parallel(isParallel())
|
||||||
.peek(e -> action.accept(e.getValue(), e.getKey()))
|
.peek(e -> action.accept(e.getValue(), e.getKey()))
|
||||||
.map(Map.Entry::getValue));
|
.map(Map.Entry::getValue));
|
||||||
@ -373,7 +373,7 @@ public interface TransformableWrappedStream<T, S extends TransformableWrappedStr
|
|||||||
Objects.requireNonNull(predicate);
|
Objects.requireNonNull(predicate);
|
||||||
if (isParallel()) {
|
if (isParallel()) {
|
||||||
final Map<Integer, T> idxMap = easyStream().toIdxMap();
|
final Map<Integer, T> idxMap = easyStream().toIdxMap();
|
||||||
return transform(EasyStream.of(idxMap.entrySet())
|
return wrap(EasyStream.of(idxMap.entrySet())
|
||||||
.parallel(isParallel())
|
.parallel(isParallel())
|
||||||
.filter(e -> predicate.test(e.getValue(), e.getKey()))
|
.filter(e -> predicate.test(e.getValue(), e.getKey()))
|
||||||
.map(Map.Entry::getValue));
|
.map(Map.Entry::getValue));
|
||||||
|
@ -603,12 +603,4 @@ public interface WrappedStream<T, S extends WrappedStream<T, S>> extends Stream<
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 转换为子类实现
|
|
||||||
*
|
|
||||||
* @param stream 流
|
|
||||||
* @return 子类实现
|
|
||||||
*/
|
|
||||||
S transform(Stream<T> stream);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -704,18 +704,6 @@ public class AbstractEnhancedWrappedStreamTest {
|
|||||||
return new Wrapper<>(source);
|
return new Wrapper<>(source);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 转换为子类实现
|
|
||||||
*
|
|
||||||
* @param stream 流
|
|
||||||
* @return 子类实现
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Wrapper<T> transform(final Stream<T> stream) {
|
|
||||||
this.stream = stream;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user