Skip to content

Instantly share code, notes, and snippets.

@matzew
Created June 18, 2015 14:19
Show Gist options
  • Save matzew/201f68a0bd525d1da846 to your computer and use it in GitHub Desktop.
Save matzew/201f68a0bd525d1da846 to your computer and use it in GitHub Desktop.
Map<String, Object> criteria = new LinkedHashMap<>();
criteria.put("categories", Arrays.asList("feedhenry"));
Map<String, Object> jsonContainer = new LinkedHashMap<>();
jsonContainer.put("alert", "Hello Luke, This is from MQTT");
jsonContainer.put("criteria", criteria);
String jsonPayload = new Gson().toJson(jsonContainer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment