Java List from Array asList(final Iterable iterable)

Here you can find the source of asList(final Iterable iterable)

Description

Converts Iterable to List .

License

Open Source License

Declaration

private static <T> List<T> asList(final Iterable<T> iterable) 

Method Source Code

    //package com.java2s;

    import java.util.ArrayList;

    import java.util.List;

    public class Main {
        /** Converts {@link Iterable} to {@link List}. */
        private static <T> List<T> asList(final Iterable<T> iterable) {
   final ArrayList<T> list = new ArrayList<>();
   iterable.forEach(input -> list.add(input));
   return list;/*from w  w  w . j a v a2s .c o  m*/
}
    }

Related

  1. asList(final E... array)
  2. asList(final int... values)
  3. asList(final int[] a)
  4. asList(final int[] a)
  5. asList(final Iterable iterable)
  6. asList(final long[] ids)
  7. asList(final Object array)
  8. asList(final Object[] arguments)
  9. asList(final Object[] array)