Java List Null Empty isNotEmpty(List list)

Here you can find the source of isNotEmpty(List list)

Description

Check if any list is not null and not empty

License

Apache License

Parameter

Parameter Description
list any list for checking
T generic type of list

Return

true if list not null and not empty

Declaration

public static <T> boolean isNotEmpty(List<T> list) 

Method Source Code


//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();
    }
}

Related

  1. isNotEmpty(List input)
  2. isNotEmpty(List input)
  3. isNotEmpty(List list)
  4. isNotEmpty(List value)
  5. isNotEmpty(List list)
  6. isNotEmpty(List list)
  7. isNotEmpty(List objList)
  8. isNotNullAndEmpty(List list)
  9. isNotNullAndNotEmpty(List list)