You can use:
new JSONObject(map);
Caution: This will only work for a Map<String, String>!
Other functions you can get from its documentation
http://stleary.github.io/JSON-java/index.html
More Related Contents:
- How do I use a custom Serializer with Jackson?
- Jackson with JSON: Unrecognized field, not marked as ignorable
- Jackson serialization: ignore empty values (or null)
- Jackson renames primitive boolean field by removing ‘is’
- How to serialize Joda DateTime with Jackson JSON processor?
- Jackson ObjectMapper – specify serialization order of object properties
- Deserialize Java 8 LocalDateTime with JacksonMapper
- How to deserialize a list using GSON or another JSON library in Java?
- How to check if a JSON key exists?
- java.net.SocketException: socket failed: EPERM (Operation not permitted)
- Jackson + Builder Pattern?
- In Spring MVC, how can I set the mime type header when using @ResponseBody
- Creating nested JSON object for the following structure in Java using JSONObject? [closed]
- READ JSON String in servlet
- Can we make object as key in map when using JSON?
- Android JSON parsing of multiple JSONObjects inside JSONObject
- Remove empty collections from a JSON with Gson
- Jackson conditional @JsonUnwrapped
- Jackson @JsonProperty(required=true) doesn’t throw an exception
- JSON to JSON transformer
- Jsonpath with Jackson or Gson
- How to Format ISO-8601 in Java
- How to Update JSON value using Java
- Jackson JSON serialization, recursion avoidance by level defining
- Java – Gson parsing nested within nested
- Jackson ObjectMapper DeserializationConfig.Feature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT
- Remove key from a Json inside a JsonObject
- Is there a SaxParser that reads json and fires events so it looks like xml
- Jackson custom annotation for custom value serialization
- Spring MVC: How to modify json response sent from controller