Java List Copy copyList(List list)

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

Description

copy List

License

Open Source License

Declaration

public static List<String> copyList(List<String> list) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Main {
    public static List<String> copyList(List<String> list) {
        if (list == null)
            return Collections.emptyList();
        List<String> result = new ArrayList<String>(list.size());
        result.addAll(list);//from   www.  j a v a  2  s.com
        return Collections.unmodifiableList(result);
    }
}

Related

  1. copyList(final List source, final List destination)
  2. copyList(final List list)
  3. copyList(List objects)
  4. copyList(List source, List destination)
  5. copyList(List src)
  6. copyList(List list)
  7. copyList(List list)
  8. copyList(List list)
  9. copyList(List master, List slave)