Java List Null Empty isNullList(List l)

Here you can find the source of isNullList(List l)

Description

Is Null or empty list

License

Mozilla Public License

Parameter

Parameter Description
l List

Return

True if Null or empty list

Declaration

public static boolean isNullList(List l) 

Method Source Code

//package com.java2s;
/*//w w  w .  jav  a  2  s  .c o m
 * The contents of this file are subject to the Mozilla Public
 * License Version 1.1 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of
 * the License at http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * rights and limitations under the License.
 *
 * The Original Code is "EINRC-7 / GDEM project".
 *
 * The Initial Developer of the Original Code is TietoEnator.
 * The Original Code code was developed for the European
 * Environment Agency (EEA) under the IDA/EINRC framework contract.
 *
 * Copyright (C) 2000-2004 by European Environment Agency.  All
 * Rights Reserved.
 *
 * Original Code: Kaido Laine (TietoEnator)
 */

import java.util.List;

public class Main {
    /**
     * Is Null or empty list
     * @param l List
     * @return True if Null or empty list
     */
    public static boolean isNullList(List l) {
        if (l == null) {
            return true;
        } else if (l.size() == 0) {
            return true;
        }

        return false;
    }
}

Related

  1. isNotEmpty(List objList)
  2. isNotNullAndEmpty(List list)
  3. isNotNullAndNotEmpty(List list)
  4. isNull(List list)
  5. isNullish(java.util.List value)
  6. isNullOrEmpty(List list)
  7. isNullOrEmpty(List list)
  8. isNullOrEmpty(List l)
  9. isNullOrEmptyAwareEqual(final List targetOne, final List targetTwo)