Here you can find the source of getIntegerArrayList(JsonArray array)
public static ArrayList<Integer> getIntegerArrayList(JsonArray array) throws ClassCastException
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import javax.json.JsonArray; import javax.json.JsonNumber; import javax.json.JsonValue; public class Main { public static ArrayList<Integer> getIntegerArrayList(JsonArray array) throws ClassCastException { ArrayList<Integer> res = new ArrayList<Integer>(array.size()); for (JsonValue v : array) { res.add(((JsonNumber) v).intValue()); }//w ww.ja v a2s . c om return res; } }