2020
12-10
12-10
Java常用对象操作工具代码实例
对象复制(反射法)publicstaticvoidcopyProp(Objectfrom,Objectto,String...filterProp){HashSet<String>filterSet=newHashSet<String>(Arrays.asList(filterProp));Class<?>fromc=from.getClass();Class<?>toc=to.getClass();List<Field>to_fields=newArrayList<Field>();while(toc!=null){to_fields.addAll(Arrays.asList(toc.getDeclaredFields()));toc=...
继续阅读 >