| package com.doumee.lib_coremodel.util; | 
|   | 
| import org.apache.commons.lang3.SerializationException; | 
| import org.apache.commons.lang3.SerializationUtils; | 
|   | 
| import java.io.Serializable; | 
| import java.util.ArrayList; | 
| import java.util.List; | 
|   | 
| public class ListUtils { | 
|     public static boolean isNonOrEmpty(List<?> list){ | 
|         return list==null||list.size()==0; | 
|     } | 
|   | 
|     public static boolean isNotNonOrEmpty(List<?> list){ | 
|         return list!=null&&list.size()!=0; | 
|     } | 
|   | 
|     /** | 
|      2      * 对集合进行深拷贝 | 
|      3      * 注意需要岁泛型类进行序列化(实现serializable) | 
|      4      * | 
|      5      * @param src | 
|      6      * @param <T> | 
|      7      * @return | 
|      8      * @throws IOException | 
|      9      * @throws ClassNotFoundException | 
|      10      */ | 
|      public static <T> List<T> deepCopy(List<T> src) { | 
|          //list深度拷贝 | 
|          List<T> newList = new ArrayList<>(); | 
|          try { | 
|              newList = (List<T>) SerializationUtils.clone((Serializable) src); | 
|          }catch (SerializationException e){ | 
|              e.printStackTrace(); | 
|          } catch (Exception e) { | 
|              e.printStackTrace(); | 
|          } | 
|          /*LogUtils.d("原list值:" + src); | 
|          LogUtils.d("新list值:" + newList);*/ | 
|          return newList; | 
|      } | 
|   | 
|     public static <T extends Serializable> T deepCopy(T src) { | 
|         T t=null; | 
|         try { | 
|             t = (T) SerializationUtils.clone((Serializable) src); | 
|         }catch (SerializationException e){ | 
|             e.printStackTrace(); | 
|         } catch (Exception e) { | 
|             e.printStackTrace(); | 
|         } | 
|          /*LogUtils.d("原list值:" + src); | 
|          LogUtils.d("新list值:" + newList);*/ | 
|         return t; | 
|     } | 
|   | 
| } |