Skip to content

Instantly share code, notes, and snippets.

@push-gists
Last active August 3, 2016 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save push-gists/91db08c027ef04bdd5c03f4b19540f03 to your computer and use it in GitHub Desktop.
Save push-gists/91db08c027ef04bdd5c03f4b19540f03 to your computer and use it in GitHub Desktop.
Transform a JSON object to a map
final Transformer<Map<String, String>, JSON> transformer = Transformers.fromMap();
final Map<String, String> keyValuePairs = new HashMap<>();
keyValuePairs.put("aKey", "aValue");
keyValuePairs.put("anotherKey", "anotherValue");
final JSON json = transformer.transform(keyValuePairs);
updater.valueUpdater(JSON.class).update("a/topic", json, callback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment