/**
*
* @ClassName: RemoveSingleChartUtil
* @Description: TODO(移除单个字符id工具类)
* @author 学渣要逆袭
* @date 2017年7月6日 上午10:03:51
*
*/
public class RemoveSingleChartUtil {
public static Object resultObj (String[] array, String compareId,Object obj,String objMethod) throws Exception{
if (array.length == 1) {
if (array[0].equals(compareId)) {
array = (String[]) ArrayUtils.remove(array, 0);
}
} else {
for (int i = 0; i < array.length;) {
if (array[i].equals(compareId)) {
if (array.length >= 1) {
array = (String[]) ArrayUtils.remove(array, i);
}
i = 0;
} else {
++i;
}
}
}
String handlMatterIds = StringUtils.join(array,",");
Method method = obj.getClass().getDeclaredMethod(objMethod,String.class);
method.invoke(obj, handlMatterIds);
return obj;
}
}