Refactory
[smsapi-java.git] / src / pl / smsapi / api / response / StatusResponse.java
blob71794acfbbda05a0d95b56e10d70f97ca00bddef
1 package pl.smsapi.api.response;
3 import java.util.ArrayList;
4 import org.json.JSONArray;
5 import org.json.JSONObject;
7 public class StatusResponse extends CountableResponse {
9 private ArrayList<MessageResponse> list = new ArrayList<MessageResponse>();
11 public StatusResponse(int count, JSONArray list) {
13 super(count);
15 final int n = list.length();
16 for (int i = 0; i < n; i++) {
17 JSONObject row = list.getJSONObject(i);
18 this.list.add(new MessageResponse(row.optString("id"), row.optString("points"), row.optString("number"), row.optString("status"), row.optString("error"), row.optString("idx")));
22 public ArrayList<MessageResponse> getList() {
23 return list;