admin管理员组

文章数量:1594753

开发中常用Spring的工具类BeanUtils.copyProperties,但BeanUtils.copyProperties属于浅复制,不能复制集合和数组,这里针对集合的复制给出解决方案

        List oldList = Arrays.asList("1","2","3");
        System.out.println(oldList);    //输出[1, 2, 3]

        List newList = (List) oldList.stream().collect(Collectors.toList());
        System.out.println(newList);   //输出[1, 2, 3]

本文标签: ListBeanUtilscopyProperties