com.gitee.feizns.StreamUtils Maven / Gradle / Ivy
package com.gitee.feizns;
import java.util.stream.Stream;
/**
* 流
* @author feizns
* @since 2019/6/9 0009
*/
public abstract class StreamUtils {
/**
* 留下第二个
* @param t
* @param t2
* @param
* @return
*/
public static final T leaveSecond(T t, T t2) {
return t2;
}
/**
* 不做改变
* @param original
* @return
*/
public static final R noChangeFun(R original) {
return original;
}
/**
* 获取字节流
* @param str
* @return
*/
public static final Stream stream(String str) {
Stream.Builder builder = Stream.builder();
if ( str != null ) {
for (int i = 0; i < str.length(); i++) {
builder.add(str.charAt(i));
}
}
return builder.build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy