Skip to content

Instantly share code, notes, and snippets.

@push-gists

push-gists/ConvertJsonToMap.java Secret

Last active May 5, 2016
Embed
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
parser.close();
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.