Java List to Array listToArray(List ids)

Here you can find the source of listToArray(List ids)

Description

Converts the give list of Long objects to array.

License

Open Source License

Parameter

Parameter Description
ids the ids list.

Return

the ids array.

Declaration

static long[] listToArray(List ids) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {
    /**/*from  w  ww.  j ava 2s.c o m*/
     * Converts the give list of Long objects to array.
     *
     * @param ids the ids list.
     * @return the ids array.
     */
    static long[] listToArray(List ids) {
        long[] result = new long[ids.size()];
        for (int i = 0; i < result.length; i++) {
            result[i] = ((Long) ids.get(i)).longValue();
        }

        return result;
    }
}

Related

  1. convertToArray(List list)
  2. convertToArray(List args)
  3. listToArray(final List list)
  4. listToArray(final List a)
  5. listToArray(List data)
  6. listToArray(List list)
  7. listToArray(List list)
  8. listToArray(List list)
  9. listToArray(List list)