Java Is Null isNotNullOrEmpty(final Object[] array)

Here you can find the source of isNotNullOrEmpty(final Object[] array)

Description

is Not Null Or Empty

License

Open Source License

Declaration

public static boolean isNotNullOrEmpty(final Object[] array) 

Method Source Code


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

import java.io.File;
import java.util.Collection;
import java.util.Date;
import java.util.Map;

public class Main {

    public static boolean isNotNullOrEmpty(final String value) {

        return !isNullOrEmpty(value);
    }//from  ww w  . j av a2 s  .com

    public static boolean isNotNullOrEmpty(final Object value) {

        return !isNullOrEmpty(value);
    }

    public static <T> boolean isNotNullOrEmpty(final Collection<T> collection) {

        return !isNullOrEmpty(collection);
    }

    public static boolean isNotNullOrEmpty(final Number number) {

        return !isNullOrEmpty(number);
    }

    public static boolean isNotNullOrEmpty(final Date data) {

        return isNullOrEmpty(data);
    }

    public static <T> boolean isNotNullOrEmpty(final Map<T, T> map) {

        return !isNullOrEmpty(map);
    }

    public static boolean isNotNullOrEmpty(final File file) {

        return !isNullOrEmpty(file);
    }

    public static boolean isNotNullOrEmpty(final Object[] array) {

        return !isNullOrEmpty(array);
    }

    public static boolean isNullOrEmpty(String value) {

        return (value == null) || (value.trim().length() == 0);
    }

    public static boolean isNullOrEmpty(Object value) {

        return value == null;
    }

    public static <T> boolean isNullOrEmpty(Collection<T> collection) {

        return (collection == null) || (collection.isEmpty());
    }

    public static boolean isNullOrEmpty(Number number) {

        return (number == null) || (!(number.doubleValue() > 0));
    }

    public static boolean isNullOrEmpty(Date data) {

        return data == null;
    }

    public static <T> boolean isNullOrEmpty(Map<T, T> map) {

        return (map == null) || (map.isEmpty());
    }

    public static boolean isNullOrEmpty(File file) {

        return isNull(file) || file.length() == 0;
    }

    public static boolean isNullOrEmpty(Object[] array) {

        return (array == null) || (array.length == 0);
    }

    public static boolean isNull(Object value) {

        return value == null;
    }
}

Related

  1. isNotNull(File file)
  2. isNull(File file)
  3. isNull(Object s)
  4. isNull(String sIn)
  5. isNullOrEmpty(Object[] array)