Code example for Gson

Methods: toJson

0
	} 
 
	public void write(T object, MediaType mediaType, HttpOutputMessage message)
			throws IOException, HttpMessageNotWritableException { 
		Writer writer = new OutputStreamWriter(message.getBody());
		gson.toJson(object, writer);
	} 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java