Java Collection Null isNull(Collection collection)

Here you can find the source of isNull(Collection collection)

Description

Determines whether or not an Collection contains only null elements.

License

Open Source License

Parameter

Parameter Description
collection a parameter

Declaration

public static boolean isNull(Collection<?> collection) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;

public class Main {
    /**//  ww w  . jav  a  2 s  . c o m
     * Determines whether or not an {@link Collection}
     * contains <i>only</i> null elements.
     *
     * @param collection
     * @return
     */
    public static boolean isNull(Collection<?> collection) {
        return collection.stream().allMatch(e -> e == null);
    }
}

Related

  1. isEmplyOrNull(Collection collection)
  2. isNotNull(Collection collection)
  3. isNull(Collection collection)
  4. isNull(Collection collection)
  5. isNull(Collection c)
  6. isNull(Collection collection)
  7. isNull(Collection collection)
  8. nullSafe(Collection collection)
  9. nullSafe(Collection collection)