Here,
isChecked
andisPrime
both are the boolean type. If I am passing integer to both value, in my java code instead of throwing exception/error (code should expect either 'true' or 'false'), it is mapping withtrue
value in my POJO class. I am assuming that it because of any number greater than 0 will take boolean true. To avoid this thing, any suggestions? I am using jax-rs for deserializing and serialize to java object.
@JsonProperty
private boolean isChecked;
(In setter method, it set with true
value)