Java Collection Empty isEmpty(Collection value)

Here you can find the source of isEmpty(Collection value)

Description

Checks if is empty.

License

Open Source License

Parameter

Parameter Description
value the value

Return

true, if is empty

Declaration

public static boolean isEmpty(Collection<?> value) 

Method Source Code


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

import java.util.Collection;

public class Main {
    /**//from w w w . ja va2  s . com
     * Checks if is empty.
     *
     * @param value
     *            the value
     * @return true, if is empty
     */
    public static boolean isEmpty(Collection<?> value) {
        if (value == null)
            return true;
        return value.isEmpty();
    }

    /**
     * Checks if is empty.
     *
     * @param <T>
     *            the generic type
     * @param value
     *            the value
     * @return true, if is empty
     */
    public static <T> boolean isEmpty(T[] value) {
        if (value == null)
            return true;
        return value.length == 0;
    }
}

Related

  1. isEmpty(Collection collection)
  2. isEmpty(Collection collection)
  3. isEmpty(Collection collection)
  4. isEmpty(Collection o)
  5. isEmpty(Collection objs)
  6. isEmpty(Collection values)
  7. isEmpty(Collection c)
  8. isEmpty(Collection data)
  9. isEmpty(Collection objectCollection)

    HOME | Copyright © www.java2s.com 2016