com.sap.it.commons.lang.Checks Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of odata-core Show documentation
Show all versions of odata-core Show documentation
SAP Cloud Platform SDK for service development
The newest version!
package com.sap.it.commons.lang;
public class Checks {
private Checks() {
}
public static T nonNull(T obj, String message) throws NullPointerException {
if (obj == null) {
throw new NullPointerException(message); // NOPMD
}
return obj;
}
public static T nonNullArgument(T obj, String message) throws IllegalArgumentException {
if (obj == null) {
throw new IllegalArgumentException(message); // NOPMD
}
return obj;
}
public static String nonEmpty(String string, String message) throws IllegalArgumentException {
if (string == null || string.isEmpty()) {
throw new IllegalArgumentException(message);
}
return string;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy