Java List from Array arrayToList(final String... array)

Here you can find the source of arrayToList(final String... array)

Description

Convert Array to list.

License

Open Source License

Parameter

Parameter Description
array the array

Return

the list

Declaration

public static List<String> arrayToList(final String... array) 

Method Source Code

//package com.java2s;
/*/* ww  w .  ja  va  2 s.  c  om*/
 * DeviceUtil.java
 * Copyright (c) 2013, EcoFactor, All Rights Reserved.
 *
 * This software is the confidential and proprietary information of EcoFactor
 * ("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
 * EcoFactor.
 */

import java.util.Arrays;

import java.util.List;

public class Main {
    /**
     * Convert Array to list.
     * @param array the array
     * @return the list
     */
    public static List<String> arrayToList(final String... array) {

        return array != null ? Arrays.asList(array) : null;
    }
}

Related

  1. arrayToJsonStringArr(List arr)
  2. arrayToList(@SuppressWarnings("unchecked") T... a)
  3. arrayToList(char[] charArr)
  4. arrayToList(Comparable[] array)
  5. arrayToList(E[] array)
  6. arrayToList(int[] a)
  7. arrayToList(int[] array)
  8. arrayToList(int[] array)
  9. arrayToList(Object arr[], int from, int length)