Check that a list is not null and that none of its elements is null. If null or if the list has emtpy elements
throws an IllegalArgumentException.
@param array the array of T.
@param name parameter name for the exception message.
340502
public static <T> T[] notNullElements(T[] array, String name) {
        notEmpty(Arrays.asList(array), name);
        for (T ele : array) {
            notNull(ele, String.format("Collection %s element %s", name, ele));
        }
        return array;
    }
788154
public static <T> Collection<T> notNullElements(Collection<T> list, String name) {
        notEmpty(list, name);
        for (T ele : list) {
            notNull(ele, String.format("Collection %s element %s", name, ele));
        }
        return list;
    }
946785
public static <T> T assertNotNull(T value, String name) {
        if (value == null)
            throw new IllegalArgumentException("Null " + name);

        return value;
    }
321717
protected void assertArrayHasLengthAndAllElementsNotNull(final Object[] array, final Integer length) throws ArgumentCountException, ArgumentNullException {

		if (array.length != length) {
			throw ArgumentCountException.notEqual(array.length, length);
		}

		for (final Object element : array) {

			if (element == null) {
				throw new ArgumentNullException();
			}
		}
	}
654220
private void checkForBlank(String value, String name) {
        if (StringUtils.isBlank(value)) {
            throw new IllegalArgumentException(name + " cannot be empty");
        }
    }
1171649
public static <T> Iterable<T> requireNonNullElements(Iterable<T> values, String name) {
        requireNonNull(values, name);

        int i = 0;
        for (T v : values) {
            if (v == null) {
                throw new NullPointerException(name + '[' + i + ']');
            }
            i++;
        }

        return values;
    }
244636
public static void notNull(@Nullable Object value, String name) {
        if (value == null) {
            throw new IllegalArgumentException(name + " must not be null!");
        }
    }
755093
private static void validate(String name, Collection<Geometry> geometries, int extent) {
        if (name == null) {
            throw new IllegalArgumentException("layer name is null");
        }
        if (geometries == null) {
            throw new IllegalArgumentException("geometry collection is null");
        }
        if (extent <= 0) {
            throw new IllegalArgumentException("extent is less than or equal to 0");
        }
    }
888154
public boolean contains(String name) {
        if (name == null) {
            throw new IllegalArgumentException("Other cannot be null");
        }

        if (this.name.equals(name)) {
            return true;
        }

        if (hasReferences()) {
            for (Marker ref : referenceList) {
                if (ref.contains(name)) {
                    return true;
                }
            }
        }
        return false;
    }
261536
public static <T> T checkNotNull(T obj, String name) {
    if (obj == null) {
      String msg = String.format("parameter '%s' cannot be null", name);
      throw new NullPointerException(msg);
    }
    return obj;
  }
225274
function findByName(array, name) {
        if (array && array.length > 0) {
            for (var i = 0, len = array.length; i < len; i++) {
                var elem = array[i];
                if (elem.name == name) {
                    return elem;
                }
            }
        }
        return null;
    }
608764
protected boolean blank(String ... names){
        //TODO: write test, move elsewhere - some helper
        for(String name:names){
            if(Util.blank(param(name))){
                return true;
            }
        }
        return false;
    }
78124
public static void contains( Collection<?> argument,
                                 Object value,
                                 String name ) {
        isNotNull(argument, name);
        if (!argument.contains(value)) {
            throw new IllegalArgumentException(CommonI18n.argumentDidNotContainObject.text(name, getObjectName(value)));
        }
    }
53919
public static final <T> boolean contains(T[] array, T item)
    {
        for (T b : array)
        {
            if (b.equals(item))
            {
                return true;
            }
        }
        return false;
    }
1199182
protected function validateNumericArray($name, $value)
    {
        if (!is_array($value) || empty($value) || !$this->isNumeric($value)) {
            throw new \Exception($name . ' must be a non-empty numeric array.');
        }
    }
496826
private static void checkTokenName(String namedOutput) {
    if (namedOutput == null || namedOutput.length() == 0) {
      throw new IllegalArgumentException(
        "Name cannot be NULL or emtpy");
    }
    for (char ch : namedOutput.toCharArray()) {
      if ((ch >= 'A') && (ch <= 'Z')) {
        continue;
      }
      if ((ch >= 'a') && (ch <= 'z')) {
        continue;
      }
      if ((ch >= '0') && (ch <= '9')) {
        continue;
      }
      throw new IllegalArgumentException(
        "Name cannot be have a '" + ch + "' char");
    }
  }
8935
public static void notNull(final Object arg, final String name) {
        if(arg == null) {
            throw new NullPointerException(String.format("%s should not be null.", name));
        }
    }