私がこれを行う場合:
public static volatile ArrayList<Process> processes = new ArrayList<Process>(){
{
add(new Process("News Workflow", "This is the workflow for the news segment", "image"));
}
};
そしてこれ:
String jsonResponse = gson.toJson(processes);
jsonResponseがnullです。
しかし、私がこれを行う場合:
public static volatile ArrayList<Process> processes = new ArrayList<Process>();
processes.add(new Process("nam", "description", "image"));
String jsonResponse = gson.toJson(processes);
Jsonの応答は次のとおりです。
[{"name":"nam","description":"description","image":"image"}]
何故ですか?