Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String asJson(final Object obj) throws JsonProcessingException {
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
- ObjectWriter ow = mapper.writer().withDefaultPrettyPrinter();
- String requestJson = ow.writeValueAsString(obj);
- return requestJson;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement