package com.engine.salary.formlua.util;


public class CompareUtil {
    public static String[] genArray(Object obj, String type) {
        String[] resultArray = new String[]{};
        if (obj.getClass().isArray()) {
            Object[] op1Array = (Object[]) obj;
            resultArray = new String[op1Array.length];
            for (int i = 0; i < op1Array.length; i++) {
                if (ExcelParamUtil.getParamContent(op1Array[i], type) != null) {
                    String p = ExcelParamUtil.getParamContent(op1Array[i], type).toString();
                    resultArray[i] = p;
                }
            }
        } else {
            if (ExcelParamUtil.getParamContent(obj, type) != null) {
                String opStr = ExcelParamUtil.getParamContent(obj, type).toString();
                resultArray = opStr.split(",");
            }
        }
        return resultArray;
    }
}
