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

com.zys.mybatis.utils.ArrayUtils Maven / Gradle / Ivy

There is a newer version: 0.2.7
Show newest version
package com.zys.mybatis.utils;

import java.lang.reflect.Array;

/**
 * @author zys
 * @version 1.0
 * @date 2021/1/25 15:49
 */
public class ArrayUtils {

    public static boolean isEmpty(Object[] array) {
        return getLength(array) == 0;
    }

    public static boolean isNotEmpty(Object... array) {
        return !isEmpty(array);
    }

    public static int getLength(Object[] array) {
        if (array == null) {
            return 0;
        }
        int length = Array.getLength(array);
        if ( (length == 1 && array[0] == null) || (length == 1 && "".equals(array[0])) ) {
            return 0;
        }
        return length;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy