Here you can find the source of containsNoNull(final Collection> c, final String s)
Parameter | Description |
---|---|
c | collection |
s | the text message that would be pass to the exception thrown when c contains a null. |
Parameter | Description |
---|---|
IllegalArgumentException | if a o == null |
public static <T> void containsNoNull(final Collection<?> c, final String s)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { /**//ww w.j a v a 2s . co m * Checks that the collection does not contain a {@code null} value (throws an {@link IllegalArgumentException} if it does). * The implementation calls {@code c.contains(null)} to determine the presence of null. * @param c collection * @param s the text message that would be pass to the exception thrown when c contains a null. * @throws IllegalArgumentException if a {@code o == null} */ public static <T> void containsNoNull(final Collection<?> c, final String s) { if (c.contains(null)) { throw new IllegalArgumentException(s); } } }