code: public JSONObject toJson() {
          JSONObject ret = new JSONObject();
          ret.put("url",url);
          if (user != null) {
              ret.put("user",user);
              ret.put("password",password);
          }
          return ret;
      }
docs: Get a JSON representation of this target configuration
  
  @return JSON representation of the target configuration