插件开发工具库,推荐依赖该工具库。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.4 KiB

package com.fanruan.api.util;
import java.io.IOException;
import java.lang.reflect.Array;
import com.fr.stable.ArrayUtils;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-08-16
*/
public class ArrayKit {
public static final String[] EMPTY_STRING_ARRAY = new String[0];
/**
* 判断数组是否为空
*
* @param array 源数组
* @return 返回数组判断为空的结果
*/
public static boolean isEmpty(Object[] array) {
return ArrayUtils.isEmpty(array);
}
/**
* 移除目标数组中对应下标的元素
*
* @param array 源数组
* @param number 要移除的元素的下标
* @return 返回移除元素后的数组
*/
public static <T> T[] remove(T[] array, int number) {
return ArrayUtils.remove(array, number);
}
/**
* 给目标数组中增加单个元素
*
* @param array 源数组
* @param element 要增加的元素
* @return 返回增加元素后的数组
*/
public static <T> T[] add(T[] array, T element) {return ArrayUtils.add(array, element);};
/**
* 给目标数组中增加多个元素
*
* @param array 源数组
* @param element 要增加的元素
* @return 返回增加元素后的数组
*/
public static <T> T[] addAll(T[] array, T... element){return ArrayUtils.addAll(array, element);};
}