Java Set to List convertSetToList(Set set)

Here you can find the source of convertSetToList(Set set)

Description

convert Set To List

License

Open Source License

Declaration

public static <T> List<T> convertSetToList(Set<T> set) 

Method Source Code

//package com.java2s;
/*//w w w.  ja  v a  2s . c om
 * Copyright 2011-2016 ZXC.com All right reserved. This software is the confidential and proprietary information of
 * ZXC.com ("Confidential Information"). You shall not disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into with ZXC.com.
 */

import java.util.ArrayList;

import java.util.List;

import java.util.Set;

public class Main {
    public static <T> List<T> convertSetToList(Set<T> set) {
        List<T> list = new ArrayList<T>();
        if (set != null && set.size() > 0) {
            for (T t : set) {
                list.add(t);
            }
        }
        return list;
    }
}

Related

  1. convertSetToList(Set set)
  2. convertSetToList(Set typeSet)
  3. convertToList(Set set)
  4. convertToList(Set set)
  5. setToList(Set set)
  6. setToList(Set set)