Java List from Array asList(T... a)

Here you can find the source of asList(T... a)

Description

as List

License

Open Source License

Parameter

Parameter Description
a a parameter

Return

null when a is null, otherwise Arrays.asList(a)

Declaration


public static <T> List<T> asList(T... a) 

Method Source Code

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

import java.util.Arrays;

import java.util.List;

public class Main {
    /**/*from  w w w.ja  v  a  2  s. c  o  m*/
     * 
     * @param a
     * @return null when a is null, otherwise Arrays.asList(a)
     */

    public static <T> List<T> asList(T... a) {
        List<T> rtn = null;
        if (a != null) {
            rtn = Arrays.asList(a);
        }
        return rtn;
    }
}

Related

  1. asList(String... args)
  2. asList(String... strings)
  3. asList(T element)
  4. asList(T firstItem, T... otherItems)
  5. asList(T... a)
  6. asList(T... a)
  7. asList(T... a)
  8. asList(T... args)
  9. asList(T... args)