Java List from Array asList(final Set elements)

Here you can find the source of asList(final Set elements)

Description

Returns the elements of the given set as list.

License

Open Source License

Parameter

Parameter Description
elements a parameter

Declaration

public static <T> List<T> asList(final Set<T> elements) 

Method Source Code

//package com.java2s;
import java.util.ArrayList;

import java.util.List;
import java.util.Set;

public class Main {
    /**/*  ww w .j a v  a  2 s.c  o m*/
     * Returns the elements of the given set as list.
     * 
     * @param elements
     * @return
     */
    public static <T> List<T> asList(final Set<T> elements) {
        final List<T> elementList = new ArrayList<T>();
        elementList.addAll(elements);
        return elementList;
    }
}

Related

  1. asList(final long[] ids)
  2. asList(final Object array)
  3. asList(final Object[] arguments)
  4. asList(final Object[] array)
  5. asList(final Object[] objectArray)
  6. asList(final T node)
  7. asList(final T... array)
  8. asList(final T... data)
  9. asList(final T... data)