So I have a method.
public String getWidgetConfigAsString(List<DashboardColumn> dashboardList) {
Gson gson = new Gson();
JsonArray widgetConfigJson = gson.toJsonTree(dashboardList).getAsJsonArray();
for (int i = 0; i < widgetConfigJson.getAsJsonArray().size(); i++) {
System.out.println(widgetConfigJson.getAsJsonArray().get(i));
}
return widgetConfigAsString;
}
And this method returns :
{"widgets":["notary_registry","notary_tasks"]}
{"widgets":["calendar"]}
{"widgets":[]}
This is a JSF dashboard layout, basicly first row is first column of a dashboard and so on.
What I want to achieve is, to get just regular multi-Array which would give me output like :
{["notary_registry","notary_tasks"]}
{["calendar"]}
{[]}