private static String toJSON ( Object data ) { try { return mapper . writeValueAsString ( data ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
Writes the data object as a JSON string .