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

com.github.restup.util.Streams Maven / Gradle / Ivy

There is a newer version: 0.0.5
Show newest version
package com.github.restup.util;

import java.util.Arrays;
import java.util.Objects;
import java.util.Set;
import java.util.function.Consumer;

public class Streams {

    private Streams() {

    }

    public static  void forEach(T[] array, Consumer action) {
        Arrays.stream(array).forEach(action);
    }

    public static  void forEachNonNull(T[] array, Consumer action) {
        Arrays.stream(array).filter(Objects::nonNull).forEach(action);
    }

    public static  void forEachNonNull(Set c, Consumer action) {
        c.stream().filter(Objects::nonNull).forEach(action);
    }
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy