public static void isInstanceOf(Class<?> type, Object obj, String message) { notNull(type, "Type to check against must not be null"); if (!type.isInstance(obj)) { throw new IllegalArgumentException( (Str.Utils.notBlank(message) ? message + " " : "") + "Object of class [" + (obj != null ? obj.getClass().getName() : "null") + "] must be an instance of " + type); } }
public static void notBlank(String text, String message) { if (!Str.Utils.notBlank(text)) { throw new IllegalArgumentException(message); } }