public static < T > String toJsonQuietly ( final T object ) { try { return ObjectToJsonExtensions . toJson ( object ) ; } catch ( final JsonProcessingException e ) { log . log ( Level . SEVERE , "An error occured when converting object to String.\nGiven object:" + object . toString ( ) + "\n" , e ) ; } return null ; }
Creates from the given Object a json string . Note if an exception occurs null will be returned .