if (!obj.isNull(dpid)) {
json = obj.getJSONArray(dpid);
for (int i = 0; i < json.length(); i++) {
obj = (JSONObject) json.get(i);
Flow flow = new Flow(dpid);
flow.setActions(ActionJSON.getActions(obj
.getJSONArray("actions")));
flow.setMatch(MatchJSON.getMatch(obj.getJSONObject("match")));
flow.setPriority(String.valueOf(obj.getInt("priority")));
if (obj.getInt("idleTimeout") != 0)
flow.setIdleTimeOut(String.valueOf(obj
.getInt("idleTimeout")));
if (obj.getInt("hardTimeout") != 0)
flow.setHardTimeOut(String.valueOf(obj
.getInt("hardTimeout")));
flow.setDurationSeconds(String.valueOf(obj
.getInt("durationSeconds")));
flow.setPacketCount(String.valueOf(obj.getInt("packetCount")));
flow.setByteCount(FormatLong.formatBytes(obj.getLong("byteCount"),false,false));
flows.add(flow);
}
}
return flows;
}