Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Usage of Jackson annotations when removing setters and zero-args constructor
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
public class JacksonBean {
private final int value;
private final String another;
@JsonCreator
public JacksonBean(@JsonProperty("value") int value, @JsonProperty("another") String another) {
this.value = value;
this.another = another;
}
public int getValue() {
return value;
}
public String getAnother() {
return another;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment