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

tech.kronicle.utils.NullUtils Maven / Gradle / Ivy

Go to download

Kronicle utils library that contains utility classes for use by Kronicle and its plugins

There is a newer version: 0.1.331
Show newest version
package tech.kronicle.utils;

import java.util.Objects;
import java.util.stream.Stream;

import static java.util.Objects.requireNonNull;

public final class NullUtils {

    public static  T firstNonNull(Stream values) {
        requireNonNull(values, "values");
        return values
                .filter(Objects::nonNull)
                .findFirst().orElse(null);
    }

    private NullUtils() {
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy