Ejemplo n.º 1
0
  public static ResponseProfileUpdate getResponseProfileGet(RequestProfileUpdate request) {
    ResponseProfileUpdate response = new ResponseProfileUpdate();

    JSONObject object = JSonCommon.updateProfile(request);
    if (object != null) {
      response.setError(JSonCommon.getString(object, "Error"));
      response.setStatus(JSonCommon.getString(object, "Status"));
      response.setMessage(JSonCommon.getString(object, "Message"));
    }
    return response;
  }
Ejemplo n.º 2
0
  public static ResponseProfileGet getResponseProfileGet(RequestProfileGet request) {
    ResponseProfileGet response = new ResponseProfileGet();
    String url = request.getUrl();
    url = url.replace("{0}", request.getToken());

    JSONObject object = JSonCommon.getJSONfromURLGET(url);
    if (object != null) {
      response.setError(JSonCommon.getString(object, "Error"));
      response.setStatus(JSonCommon.getString(object, "Status"));
      response.setMessage(JSonCommon.getString(object, "Message"));
      response.setAge(JSonCommon.getString(object, "Age"));
      response.setCountry(JSonCommon.getString(object, "Country"));
      response.setEmail(JSonCommon.getString(object, "Email"));
      response.setFirstName(JSonCommon.getString(object, "FirstName"));
      response.setPassword(JSonCommon.getString(object, "Password"));
      response.setUserName(JSonCommon.getString(object, "UserName"));
      response.setZip(JSonCommon.getString(object, "Zip"));
      response.setIdCountry(JSonCommon.getString(object, "idCountry"));
    }
    return response;
  }