Java List Null Empty nullOrEmpty(List s)

Here you can find the source of nullOrEmpty(List s)

Description

Check if List is null or empty

License

Apache License

Parameter

Parameter Description
s a string

Return

return true if String is null or empty

Declaration

public static boolean nullOrEmpty(List<Long> s) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.List;

public class Main {
    /**// www.j ava  2  s  . c  om
     * Check if String is null or empty
     * @param s a string
     * @return return true if String is null or empty
     */
    public static boolean nullOrEmpty(String s) {
        return s == null || s.isEmpty();
    }

    /**
     * Check if Long is null or zero
     * @param s a string
     * @return return true if String is null or zero
     */
    public static boolean nullOrEmpty(Long s) {
        return s == null || s == 0;
    }

    /**
     * Check if double is zero
     * @param s a string
     * @return return true if String is zero
     */
    public static boolean nullOrEmpty(double s) {
        return s == 0;
    }

    /**
     * Check if List is null or empty
     * @param s a string
     * @return return true if String is null or empty
     */
    public static boolean nullOrEmpty(List<Long> s) {
        return s == null || s.isEmpty();
    }
}

Related

  1. listWithoutNull(final List list)
  2. maskNull(List pTypes)
  3. newListIfNull(List list)
  4. newListWhenNull(List list)
  5. newListWithOneNull()
  6. nullOrEmptyList(List list)
  7. nullSafeAdd(List list, T elem)
  8. nullsafeAsList(T... elements)
  9. nullSafeList(List list)