@Test public void serializeNulls() { Gson gson = new GsonBuilder() .serializeNulls() .create(); om = new GsonObjectMapper(gson); TestMe testMe = new TestMe(null, null, null); assertEquals("{\"text\":null,\"nmbr\":null,\"another\":null}", om.writeValue(testMe)); }
@Override public String writeValue(Object value) { return om.toJson(value); }
GsonObjectMapper implements ObjectMapper { @Override public String writeValue(Object value) { return om.toJson(value); } }
GsonObjectMapper implements ObjectMapper { @Override public String writeValue(Object value) { return om.toJson(value); } GsonObjectMapper();  GsonObjectMapper(Gson om); }
GsonObjectMapper implements ObjectMapper { @Override public String writeValue(Object value) { return om.toJson(value); } GsonObjectMapper();  GsonObjectMapper(Gson om); @Override T readValue(String value, Class<T> valueType); @Override T readValue(String value, GenericType<T> genericType); @Override String writeValue(Object value); }
GsonObjectMapper implements ObjectMapper { @Override public String writeValue(Object value) { return om.toJson(value); } GsonObjectMapper();  GsonObjectMapper(Gson om); @Override T readValue(String value, Class<T> valueType); @Override T readValue(String value, GenericType<T> genericType); @Override String writeValue(Object value);  }