<p>
convert.
</p>

@param datas an array of {@link java.lang.Object} objects.
@param clazz a {@link java.lang.Class} object.
@param <T> a T object.
@return an array of T objects.
342616
public <T> T[] convert(Object[] datas, Class<T> clazz) {
    if (null == datas) { return null; }
    @SuppressWarnings("unchecked")
    T[] newDatas = (T[]) Array.newInstance(clazz, datas.length);
    for (int i = 0; i < datas.length; i++) {
      newDatas[i] = convert(datas[i], clazz);
    }
    return newDatas;
  }
205212
@SuppressWarnings("unchecked")
    public static <T> T convertValue(JsonNode node, Class<T> clazz) {
        if (node instanceof POJONode) {
            return convertValue(DPathUtils.extractValue((POJONode) node), clazz);
        }
        if (clazz == null) {
            throw new NullPointerException("Class parameter is null!");
        }
        if (node == null || node instanceof NullNode || node instanceof MissingNode) {
            return null;
        }
        if (node instanceof POJONode) {
            return convertValue(DPathUtils.extractValue((POJONode) node), clazz);
        }
        if (Number.class.isAssignableFrom(clazz) || byte.class == clazz || short.class == clazz
                || int.class == clazz || long.class == clazz || float.class == clazz
                || double.class == clazz) {
            return convertNumber(node, clazz);
        }
        if (clazz == Boolean.class || clazz == boolean.class) {
            return (T) convertBoolean(node);
        }
        if (clazz == Character.class || clazz == char.class) {
            return (T) convertChar(node);
        }
        if (Date.class.isAssignableFrom(clazz)) {
            return (T) convertDate(node);
        }
        if (Object[].class.isAssignableFrom(clazz) || List.class.isAssignableFrom(clazz)) {
            return (T) convertArrayOrList(node);
        }
        if (clazz.isAssignableFrom(node.getClass())) {
            return (T) node;
        }
        if (clazz == String.class) {
            return (T) (node.isTextual() ? node.asText() : node.toString());
        }
        throw new IllegalArgumentException(
                "Cannot convert an object of type [" + node.getClass() + "] to [" + clazz + "]!");
    }
1206007
public static <T> T deserialize(final byte[] inBytes, final Class<T> clazz) {
        val inputStream = new ByteArrayInputStream(inBytes);
        return deserialize(inputStream, clazz);
    }
1321507
public static <T> Object[] toBeanArray(String text, Class<T> clazz) {
        return JSON.parseArray(text, clazz).toArray();
    }
545112
public static List<DataPoint> parse(int[] values, long ts) {
        List<DataPoint> ret = new ArrayList<DataPoint>(values.length);
        for (int v : values) {
            ret.add(new DataPoint(ts, v));
        }
        return ret;
    }
381813
protected <T extends IQueueMessage<ID, DATA>> T deserialize(byte[] data, Class<T> clazz) {
        return data != null ? SerializationUtils.fromByteArray(data, clazz) : null;
    }
1327019
private <T extends D6Model> T[] toArray(List<Object> objectList, Class<T> modelClazz) {

    if (objectList == null) {
      return (T[]) Array.newInstance(modelClazz, 0);
    }

    final T[] resultObjects = objectList.toArray((T[]) Array.newInstance(modelClazz, 0));

    return resultObjects;
  }
512354
public static <T> List<T> toList(Object array, Class<T> clazz) {
        List<T> list = new ArrayList<>();
        for (Object o : toObjectArray(array)) {
            list.add(Reflection.toType(o, clazz));
        }
        return list;
    }
126212
private static Class<?>[] convert(Class<?>[] classes) {
        Class<?>[] types = new Class<?>[classes.length];
        for (int i = 0; i < types.length; i++) {
            types[i] = convert(classes[i]);
        }
        return types;
    }
462218
static <T> T convertToCustomClass(Object object, Class<T> clazz) {
    return deserializeToClass(object, clazz, ErrorPath.EMPTY);
  }
171873
private List<?> convertDataToList(final Object data) {
		if (data == null) {
			return null;
		} else if (data instanceof List) {
			return (List<?>) data;
		} else if (data instanceof Object[]) {
			return Arrays.asList((Object[]) data);
		} else {
			return Arrays.asList(new Object[]{data});
		}
	}
1007185
public static Class[] convertToTypeArray(Object[] args) {
        if (args == null)
            return null;
        int s = args.length;
        Class[] ans = new Class[s];
        for (int i = 0; i < s; i++) {
            Object o = args[i];
            ans[i] = getClassWithNullAndWrapper(o);
        }
        return ans;
    }
531635
public <T> List<T> parse(Class<T> clazz) {
        List<T> resultList = null;
        try {
            Sheet sheet = workbook.getSheet(this.sheetName);
            if (null != sheet) {
                resultList = new ArrayList<T>(sheet.getLastRowNum() - 1);
                Row row = sheet.getRow(this.startRow);

                Map<String, Field> fieldMap = new HashMap<String, Field>();
                Map<String, String> titleMap = new HashMap<String, String>();

                Field[] fields = clazz.getDeclaredFields();
                //这里开始处理映射类型里的注解
                for (Field field : fields) {
                    if (field.isAnnotationPresent(TitleCell.class)) {
                        TitleCell mapperCell = field.getAnnotation(TitleCell.class);
                        fieldMap.put(mapperCell.name(), field);
                    }
                }

                for (Cell title : row) {
                    CellReference cellRef = new CellReference(title);
                    titleMap.put(cellRef.getCellRefParts()[2], title.getRichStringCellValue().getString());
                }

                for (int i = this.startRow + 1; i <= sheet.getLastRowNum(); i++) {
                    T t = clazz.newInstance();
                    Row dataRow = sheet.getRow(i);
                    for (Cell data : dataRow) {
                        CellReference cellRef = new CellReference(data);
                        String cellTag = cellRef.getCellRefParts()[2];
                        String name = titleMap.get(cellTag);
                        Field field = fieldMap.get(name);
                        if (null != field) {
                            field.setAccessible(true);
                            getCellValue(data, t, field);
                        }
                    }
                    resultList.add(t);
                }
            } else {
                throw new RuntimeException("sheetName:" + this.sheetName + " is not exist");
            }
        } catch (InstantiationException e) {
            LOG.error("初始化异常", e);
        } catch (IllegalAccessException e) {
            LOG.error("初始化异常", e);
        } catch (ParseException e) {
            LOG.error("时间格式化异常:{}", e);
        } catch (Exception e) {
            LOG.error("其他异常", e);
        }
        return resultList;
    }
36787
public static <T> List<List<T>> matrixTransform(List<List<T>> datas) {
        if (datas.size() == 0 || datas.get(0).size() == 0) {
            return datas;
        }
        int column = datas.size();
        int row = datas.get(0).size();
        List<List<T>> newData = new ArrayList<>(row);
        for (int i = 0; i < row; i++) {
            List<T> list = new ArrayList<>(column);
            for (int j = 0; j < column; j++) {
                list.add(datas.get(j).get(i));
            }
            newData.add(list);
        }
        return newData;
    }
784504
@SuppressWarnings("unchecked")
  public <T> T get(String key, Class<T> clazz) {
    return (T) datas.get(key);
  }
946415
public static String fromObjects(String[] headers, Object[][] data) {
    if (headers == null) throw new NullPointerException("headers == null");
    if (data == null) throw new NullPointerException("data == null");

    List<String[]> stringData = new ArrayList<>();
    for (Object[] row : data) {
      String[] stringRow = new String[row.length];
      for (int column = 0; column < row.length; column++) {
        stringRow[column] = String.valueOf(row[column]);
      }
      stringData.add(stringRow);
    }

    String[][] dataArray = stringData.toArray(new String[stringData.size()][]);
    return FlipTable.of(headers, dataArray);
  }
1162873
public static List<ConversionMethod> getConversionMethods(Class<?> clazz){
		List<ConversionMethod> conversions = new ArrayList<ConversionMethod>();
		
			for(Method method:getAnnotatedMethods(clazz))
				try{   conversions.add(Converter.toConversionMethod(method));
				}catch (ConversionParameterException e) {
					Error.wrongParameterNumber(method.getName(),clazz.getSimpleName());
				}catch (DynamicConversionParameterException e) {
					Error.parametersUsageNotAllowed(method.getName(), clazz.getSimpleName());
				}catch (DynamicConversionMethodException e) {
					Error.incorrectMethodDefinition(method.getName(), clazz.getSimpleName());
				}catch (DynamicConversionBodyException e) {
					Error.incorrectBodyDefinition(method.getName(), clazz.getSimpleName());
				}
		return conversions;
	}