Java Collection Null isNull(Collection collection)

Here you can find the source of isNull(Collection collection)

Description

Returns true if the collection is null or empty

License

Open Source License

Parameter

Parameter Description
collection a parameter

Declaration

@Deprecated
public static boolean isNull(Collection<?> collection) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2014, 2016 Chaupal./* www.j  a v a  2 s  .  co  m*/
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Apache License, Version 2.0
 * which accompanies this distribution, and is available at
 * http://www.apache.org/licenses/LICENSE-2.0.html
 *******************************************************************************/

import java.util.Collection;

public class Main {
    /**
     * returns true if the string is null or empty
     * @param str
     * @return
     * @deprecated Use assertNull
     */
    @Deprecated
    public static final boolean isNull(String str) {
        return ((str == null) || (str.trim().length() == 0));
    }

    /**
     * Returns true if the collection is null or empty
     * @param collection
     * @return
     * @deprecated Use assertNull
     */
    @Deprecated
    public static boolean isNull(Collection<?> collection) {
        return ((collection == null) || (collection.isEmpty()));
    }

    /**
     * Returns true if the collection is null or empty
     * @param collection
     * @return
     * @deprecated Use assertNull
     */
    @Deprecated
    public static boolean isNull(Object[] collection) {
        return ((collection == null) || (collection.length == 0));
    }
}

Related

  1. isNull(Collection collection)
  2. isNull(Collection collection)
  3. isNull(Collection c)
  4. isNull(Collection collection)
  5. isNull(Collection collection)
  6. nullSafe(Collection collection)
  7. nullSafe(Collection collection)
  8. nullSafe(Collection in)
  9. nullSafeCollection(Collection source)