title: get the data from web service response in retrofit android
body: <p>i am working on retrofit from four days. I learnt how to get the data from web service but now i stuck with this response. please any one tell me how to get the data from  web service.  how to get the operator id,operator, RechareTypes array of strings. Please any one help me. Thanks in advance. </p>
  
  <p>my code:
   operator:</p>
  
  <pre><code>public class Operator {
      @Expose
      private String OperatorID="";
      @Expose
      private String ServiceTypeID="";
  
      public String getServiceTypeID() {
          return ServiceTypeID;
      }
  
      public void setServiceTypeID(String serviceTypeID) {
          ServiceTypeID = serviceTypeID;
      }
  
      public String getOperatorID() {
          return OperatorID;
      }
  
      public void setOperatorID(String operatorID) {
          OperatorID = operatorID;
      }
  
      public String getOperatorname() {
          return operatorname;
      }
  
      public List&lt;Operators&gt; getOrderItems() {
          return OrderItems;
      }
  
      public void setOrderItems(List&lt;Operators&gt; orderItems) {
          OrderItems = orderItems;
      }
  
      public void setOperatorname(String operatorname) {
          this.operatorname = operatorname;
      }
  
      @Expose
  
      private String operatorname="";
      @Expose
      private List&lt;Operators&gt; OrderItems = new ArrayList&lt;Operators&gt;();
      public Operator(){
  
      }
  }
  </code></pre>
  
  <p>operators:</p>
  
  <pre><code>public class Operators {
     private  String RechargeTypeID="";
  
      public String getRechargeType() {
          return RechargeType;
      }
  
      public void setRechargeType(String rechargeType) {
          RechargeType = rechargeType;
      }
  
      public String getSMSCode() {
          return SMSCode;
      }
  
      public void setSMSCode(String SMSCode) {
          this.SMSCode = SMSCode;
      }
  
      public String getRechargeTypeID() {
          return RechargeTypeID;
      }
  
      public void setRechargeTypeID(String rechargeTypeID) {
          RechargeTypeID = rechargeTypeID;
      }
  
      private String RechargeType="";
      private String SMSCode="";
  }
  </code></pre>
  
  <p>activity:</p>
  
  <pre><code>ArrayList&lt;Operator&gt; operator;
  
      void executeCircleAndOperatorsList() {
              db.ClearTables();
              ServiceClient serviceClient = ServiceUtil.getServiceClient();
  
              JsonParser jsonParser = new JsonParser();
  
              serviceClient.getOperators("getRecharge_Operator_v2", operatorCallback);
  
          }
  
  Callback&lt;JsonObject&gt; operatorCallback = new Callback&lt;JsonObject&gt;() {
  
          @Override
          public void success(final JsonObject jsonObject, Response response) {
              parseoperators(jsonObject);
              Thread t=new Thread(new Runnable() {
                  @Override
                  public void run() {
                      parseoperators(jsonObject);
                  }
              });
              t.start();
          }
  
          @Override
          public void failure(RetrofitError error) {
  
          }
      };
    public void parseoperators(JsonObject result) {
        if(result.has("Status")){
            try{
                String Status = result.get("Status")
                        .getAsString();
                if (Status.equals("1")) {
                    Gson gson = new Gson();
                    JsonArray array = result.get(
                            "data").getAsJsonArray();
                    Log.v("TAG_CIRCLELIST", "" + array);
                    Type type = new TypeToken&lt;ArrayList&lt;Operator&gt;&gt;() {
                    }.getType();
  
                    operator.addAll((Collection&lt;? extends Operator&gt;) gson
                            .fromJson(array, type));
  
  
  
  
                }
                else {
                    throw new JSONException("Something went wrong ");
                }
            }
            catch(JSONException e){
  
            }
  
        }
  
  
  
      }
  </code></pre>
  
  <p>json:</p>
  
  <pre><code>{
      "Status": 1,
      "data": [
          {
              "ServiceTypeID": 1,
              "OperatorID": 1,
              "Operator": "Airtel",
              "RechareTypes": [
                  {
                      "RechargeTypeID": 1,
                      "RechargeType": "Topup",
                      "SMSCode": "AIRT"
                  }
              ]
          },
          {
              "ServiceTypeID": 1,
              "OperatorID": 2,
              "Operator": "BSNL",
              "RechareTypes": [
                  {
                      "RechargeTypeID": 2,
                      "RechargeType": "Topup",
                      "SMSCode": "BSNL"
                  },
                  {
                      "RechargeTypeID": 3,
                      "RechargeType": "Special",
                      "SMSCode": "BSNLSPL"
                  }
              ]
          },
          {
              "ServiceTypeID": 1,
              "OperatorID": 3,
              "Operator": "Aircel",
              "RechareTypes": [
                  {
                      "RechargeTypeID": 4,
                      "RechargeType": "Topup",
                      "SMSCode": "AIRC"
                  }
              ]
          },
          {
              "ServiceTypeID": 1,
              "OperatorID": 4,
              "Operator": "Idea",
              "RechareTypes": [
                  {
                      "RechargeTypeID": 5,
                      "RechargeType": "Topup",
                      "SMSCode": "IDEA"
                  }
              ]
            }
      ]
  }
  </code></pre>