Here you can find the source of isEmpty(java.util.List> list)
Parameter | Description |
---|---|
list | the list to examine. |
public static boolean isEmpty(java.util.List<?> list)
//package com.java2s; public class Main { /**// w w w .j a v a2 s .c o m * Determine whether an object reference is null or a reference to an empty string. * * @param s the reference to examine. * * @return true if the reference is null or is a zero-length {@link String}. */ public static boolean isEmpty(Object s) { return s == null || (s instanceof String && ((String) s).length() == 0); } /** * Determine whether an {@link List} is null or empty. * * @param list the list to examine. * * @return true if the list is null or zero-length. */ public static boolean isEmpty(java.util.List<?> list) { return list == null || list.size() == 0; } }