public ListDouble getListDouble(String string) { JsonArray array = getJsonArray(string); return toListDouble(array); }
public ListFloat getListFloat(String string) { JsonArray array = getJsonArray(string); return toListFloat(array); }
public ListInt getListInt(String string) { JsonArray array = getJsonArray(string); return toListInt(array); }
public ListLong getListLong(String string) { JsonArray array = getJsonArray(string); return toListLong(array); }
public ListShort getListShort(String string) { JsonArray array = getJsonArray(string); return toListShort(array); }
public List<String> getListString(String string) { JsonArray array = getJsonArray(string); return toListString(array); }
public ListByte getListByte(String string) { JsonArray array = getJsonArray(string); return toListByte(array); }
public List<Class<?>> getColumnTypes(String string) { JsonArray array = getJsonArray(string); List<Class<?>> types = new ArrayList<>(); for (int i = 0; i < array.size(); i++) { String type = array.getString(i); if ("String".equals(type)) { types.add(String.class); } else if ("double".equals(type)) { types.add(double.class); } else if ("float".equals(type)) { types.add(float.class); } else if ("long".equals(type)) { types.add(long.class); } else if ("int".equals(type)) { types.add(int.class); } else if ("short".equals(type)) { types.add(short.class); } else if ("byte".equals(type)) { types.add(byte.class); } else if ("Timestamp".equals(type)) { types.add(Instant.class); } else { throw new IllegalArgumentException("Column type " + type + " not supported"); } } return types; }
public ListBoolean getListBoolean(String string) { JsonArray array = getJsonArray(string); boolean[] values = new boolean[array.size()]; for (int i = 0; i < values.length; i++) { values[i] = array.getBoolean(i); } return new ArrayBoolean(values); }
public List<Object> getColumnValues(String string, List<Class<?>> types) { JsonArray array = getJsonArray(string); List<Object> result = new ArrayList<>(); for (int i = 0; i < types.size(); i++) { Class<?> type = types.get(i); if (String.class.equals(type)) { result.add(toListString(array.getJsonArray(i))); } else if (double.class.equals(type)) { result.add(toListDouble(array.getJsonArray(i))); } else if (float.class.equals(type)) { result.add(toListFloat(array.getJsonArray(i))); } else if (long.class.equals(type)) { result.add(toListLong(array.getJsonArray(i))); } else if (int.class.equals(type)) { result.add(toListInt(array.getJsonArray(i))); } else if (short.class.equals(type)) { result.add(toListShort(array.getJsonArray(i))); } else if (byte.class.equals(type)) { result.add(toListByte(array.getJsonArray(i))); } else if (Instant.class.equals(type)) { result.add(toListTimestamp(array.getJsonArray(i))); } else { throw new IllegalArgumentException("Column type " + type + " not supported"); } } return result; }