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

no.nav.apiapp.util.StringUtils Maven / Gradle / Ivy

package no.nav.apiapp.util;

import java.util.Optional;

public class StringUtils {

    public static boolean notNullOrEmpty(String string) {
        return string != null && string.trim().length() > 0;
    }

    public static Optional of(String string) {
        return Optional.ofNullable(string).filter(StringUtils::notNullOrEmpty);
    }

    public static boolean nullOrEmpty(String string) {
        return !notNullOrEmpty(string);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy