All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.hdy.common.util.ArrayUtils Maven / Gradle / Ivy

There is a newer version: 2.0.5
Show newest version
package com.github.hdy.common.util;

/**
 * ArrayUtils工具类
 *
 * @author 贺大爷
 * @date 2019/6/25
 */
public final class ArrayUtils {

    /**
     * 判断数据是否为空
     *
     * @param array 长度
     *
     * @return 数组对象为null或者长度为 0 时,返回 false
     */
    public static boolean isEmpty(Object[] array) {
        return array == null || array.length == 0;
    }

    /**
     * 判断数组是否不为空
     *
     * @param array 数组
     *
     * @return 数组对象内含有任意对象时返回 true
     *
     * @see ArrayUtils#isEmpty(Object[])
     */
    public static boolean isNotEmpty(Object[] array) {
        return !isEmpty(array);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy