Here you can find the source of isNotEmpty(List
null
and not empty
Parameter | Description |
---|---|
list | any list for checking |
T | generic type of list |
true
if list not null
and not empty
public static <T> boolean isNotEmpty(List<T> list)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { /**/* w ww . j a v a2 s . co m*/ * Check if any list is not <code>null</code> and not empty * * @param list any list for checking * @param <T> generic type of list * @return <code>true</code> if list not <code>null</code> and not empty */ public static <T> boolean isNotEmpty(List<T> list) { return list != null && !list.isEmpty(); } }