public static void toJson(VertxApiRequest obj, JsonObject json) { if (obj.getApiKey() != null) { json.put("apiKey", obj.getApiKey()); } if (obj.getDestination() != null) { json.put("destination", obj.getDestination()); } if (obj.getHeaders() != null) { JsonObject map = new JsonObject(); obj.getHeaders().forEach((pair) -> map.put(pair.getKey(), pair.getValue())); json.put("headers", map); } if (obj.getQueryParams() != null) { JsonObject map = new JsonObject(); obj.getQueryParams().forEach((pair) -> map.put(pair.getKey(), pair.getValue())); json.put("queryParams", map); } if (obj.getRawRequest() != null) { json.put("rawRequest", obj.getRawRequest()); } if (obj.getRemoteAddr() != null) { json.put("remoteAddr", obj.getRemoteAddr()); } if (obj.getApiId() != null) { json.put("serviceId", obj.getApiId()); } if (obj.getApiOrgId() != null) { json.put("serviceOrgId", obj.getApiOrgId()); } if (obj.getApiVersion() != null) { json.put("serviceVersion", obj.getApiVersion()); } json.put("transportSecure", obj.isTransportSecure()); if (obj.getType() != null) { json.put("type", obj.getType()); } }