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

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

Description

as List

License

Apache License

Declaration


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

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Arrays;

import java.util.Collections;

import java.util.List;

public class Main {

    public static <T> List<T> asList(T... args) {
        if (args == null || args.length == 0) {
            return Collections.emptyList();
        } else {/*from w  ww.  ja  v  a  2  s  . co m*/
            return Arrays.asList(args);
        }
    }
}

Related

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