Compare commits

..
Author SHA1 Message Date
minglipro 9d118ed98d no message 2025-09-11 21:32:01 +08:00
minglipro 6b7555d727 no message 2025-09-11 20:49:33 +08:00
5 changed files with 28 additions and 8 deletions
+1 -1
View File
@@ -22,4 +22,4 @@
JDKVERSIONS=1.8 JDKVERSIONS=1.8
GROUPSID=com.mingliqiye.utils GROUPSID=com.mingliqiye.utils
ARTIFACTID=mingli-utils ARTIFACTID=mingli-utils
VERSIONS=3.2.3 VERSIONS=3.2.5
@@ -0,0 +1,7 @@
/**
*
* AES 加密
* @author MingLiPro
*
*/
package com.mingliqiye.utils.aes;
@@ -23,13 +23,14 @@
package com.mingliqiye.utils.collection; package com.mingliqiye.utils.collection;
import com.mingliqiye.utils.stream.SuperStream; import com.mingliqiye.utils.stream.SuperStream;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.function.Predicate; import java.util.function.Predicate;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/** /**
* 集合工具类,提供对列表和数组的常用操作方法。 * 集合工具类,提供对列表和数组的常用操作方法。
@@ -337,4 +338,10 @@ public class Collection {
) { ) {
return new ArrayList<>(collection); return new ArrayList<>(collection);
} }
public static <T> SuperStream<T> toSuperStream(
@NotNull java.util.Collection<T> list
) {
return SuperStream.of(list);
}
} }
@@ -1,10 +1,13 @@
package com.mingliqiye.utils.stream; package com.mingliqiye.utils.stream;
import java.io.*;
import java.util.List;
import lombok.Getter; import lombok.Getter;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.List;
public class InputStreanWrapper extends InputStream implements AutoCloseable { public class InputStreanWrapper extends InputStream implements AutoCloseable {
@Getter @Getter
@@ -72,9 +75,9 @@ public class InputStreanWrapper extends InputStream implements AutoCloseable {
* jdk8 兼容实现 jdk9+ <br> * jdk8 兼容实现 jdk9+ <br>
* 请使用 InputStream.transferTo() * 请使用 InputStream.transferTo()
* *
* @param outputStream * @param outputStream 输出流
* @return 转换的字节数 * @return 转换的字节数
* @throws IOException * @throws IOException IO错误
*/ */
public long transferToOutputStream(OutputStream outputStream) public long transferToOutputStream(OutputStream outputStream)
throws IOException { throws IOException {
@@ -295,8 +295,9 @@ public class SuperStream<T> implements Stream<T> {
* *
* @param predicate 谓词函数 * @param predicate 谓词函数
* @return SuperStream 实例 * @return SuperStream 实例
* @since 3.2.5
*/ */
public SuperStream<T> filter(Function<T, Boolean> predicate) { public SuperStream<T> filterBoolean(Function<T, Boolean> predicate) {
return new SuperStream<>(stream.filter(predicate::apply)); return new SuperStream<>(stream.filter(predicate::apply));
} }
@@ -1430,6 +1431,8 @@ public class SuperStream<T> implements Stream<T> {
* 返回一个收集器,将元素收集到 List 中。 * 返回一个收集器,将元素收集到 List 中。
* *
* @param <T> 元素类型 * @param <T> 元素类型
* @param <K> Map.Key
* @param <V> Map.Value
* @return 收集器 * @return 收集器
*/ */
public static <T extends Map.Entry<K, V>, K, V> Collector< public static <T extends Map.Entry<K, V>, K, V> Collector<