Skip to content

Instantly share code, notes, and snippets.


push-gists/ Secret

Last active May 5, 2016
What would you like to do?
Convert a JSON value to a map
// Construct the Jackson factory objects
final CBORFactory factory = new CBORFactory();
final ObjectMapper mapper = new ObjectMapper(factory);
// Create a CBOR parse for the JSON value
final CBORParser parser = factory.createParser(json.asInputStream());
// Bind the value as a map
final Map<String, Object> value = mapper.readValue(parser, new TypeReference<Map<String, Object>>() { });
// Close the parser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.