json simply giving mapperException
Conflicting setter definitions for property
public void setJanuary(String january) {
try {
setJanuary(Float.parseFloat(january));
} catch (NumberFormatException exception) {
setJanuary(0);
}
}public void setJanuary(float january) {
this.january = january;
}
Problem resolved by using Annotation @JsonSetter for which setter we are using from Json
Use the @JsonIgnore
annotation on the setter methods that should be excluded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With