code: private static String toJsonStr(Object object) throws JsonGenerationException, JsonMappingException, IOException{
          return mapper.writeValueAsString(object);
      }
docs: Transfer Object to JSON String.
  
  @param object
  the target Object.
  @return
  JSON String.
  @throws JsonGenerationException
  @throws JsonMappingException
  @throws IOException