I have a model(I have omitted getters and setters for brevity) that looks like this:
public class ObjkeyInputPayloadItem {
private String TYPE;
private String BALL_NAME;
private String TABLENAME;
private String PARAMTYPE;
private String FIELDNAME;
private String FIELDVALUE;
}
I would like to convert it to json using ObjectMapper
in jackson
API:
String payloadStr = null;
try {
payloadStr = mapper.writeValueAsString(payload);
} catch (JsonGenerationException e) {
e.printStackTrace();
} catch (JsonMappingException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
I use the payloadStr
as a camel cased string, how can I tell the ObjectMapper
to use my bean's properties as they are without converting them.