com.github.cloudyrock.dimmer.Util Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dimmer-core Show documentation
Show all versions of dimmer-core Show documentation
Lightweight library to manage feature toggling. Unlike others Dimmer doesn't work
in switch mode, black or white, It provides a flexible way to respond to disabled
features by adding customizable behaviours and pre-configured responses.
package com.github.cloudyrock.dimmer;
import java.lang.reflect.Array;
import java.util.Collection;
import java.util.Objects;
/**
* @author Antonio Perez Dieppa
* @since 11/06/2018
*/
final class Util {
static void checkArgumentNullEmpty(Object arg, String argName) {
if (Objects.isNull(arg)) {
throw new IllegalArgumentException(
String.format("arg %s cannot be null", argName));
}
if ((arg.getClass().isArray() && Array.getLength(arg) <= 0)
|| (arg instanceof Collection && ((Collection) arg).isEmpty())) {
throw new IllegalArgumentException(
String.format("arg %s cannot be empty", argName));
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy