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

net.n2oapp.framework.access.functions.StreamUtil Maven / Gradle / Ivy

The newest version!
package net.n2oapp.framework.access.functions;

import java.util.Collection;
import java.util.stream.Stream;

import static java.util.Arrays.stream;

/**
 * @author V. Alexeev.
 */
public class StreamUtil {

    @SafeVarargs
    public static  Stream safeStreamOf(T... t) {
        return t == null ? Stream.empty() : stream(t);
    }

    public static  Stream safeStreamOf(Collection t) {
        return t == null ? Stream.empty() : t.stream();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy