All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gitee.feizns.StreamUtils Maven / Gradle / Ivy

Go to download

Java 类型,反射,属性以及实体类操作工具类。

There is a newer version: 5.5-RELEASE
Show newest version
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