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

org.flips.utils.ValidationUtils Maven / Gradle / Ivy

Go to download

Flips Core framework, provides all the flip annotations, conditions and different advices

There is a newer version: 1.1
Show newest version
package org.flips.utils;


public final class ValidationUtils {

    private ValidationUtils() {
        throw new AssertionError("No ValidationUtils instances for you!");
    }

    public static final String requireNonEmpty(String str, String message) {
        boolean isEmpty = Utils.isEmpty(str);
        if ( isEmpty )
            throw new IllegalArgumentException(message);
        return str;
    }

    public static final  T[] requireNonEmpty(T[] t, String message) {
        if ( Utils.isEmpty(t) )
            throw new IllegalArgumentException(message);
        return t;
    }

    public static final Object requireNonNull(Object o, String message) {
        if ( o == null )
            throw new IllegalArgumentException(message);
        return o;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy