Java List Copy copyList(List original)

Here you can find the source of copyList(List original)

Description

copy List

License

Apache License

Declaration

private static <T> List<T> copyList(List<T> original) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.*;

public class Main {
    private static <T> List<T> copyList(List<T> original) {
        List<T> copy = null;

        if (original != null) {
            copy = new ArrayList<T>();

            if (!original.isEmpty()) {
                copy.addAll(original);/*from  ww w.  ja  va 2 s  .c  o  m*/
            }
        }

        return copy;
    }
}

Related

  1. copyList(List list)
  2. copyList(List list)
  3. copyList(List list)
  4. copyList(List list)
  5. copyList(List master, List slave)
  6. copyList(Object object)
  7. copyListOnlySpecified(List list, int[] indexes)
  8. copyListRaw(List master, List slave)
  9. copyNullable(List original)