a guest Jun 20th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public static String asJson(final Object obj) throws JsonProcessingException {
  2.         ObjectMapper mapper = new ObjectMapper();
  3.         mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
  4.         ObjectWriter ow = mapper.writer().withDefaultPrettyPrinter();
  5.         String requestJson = ow.writeValueAsString(obj);
  6.         return requestJson;
  7.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand