Skip to content

Instantly share code, notes, and snippets.

@liviutudor
Created September 16, 2017 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liviutudor/43655c5cb72300e46e3b00c5750b6490 to your computer and use it in GitHub Desktop.
Save liviutudor/43655c5cb72300e46e3b00c5750b6490 to your computer and use it in GitHub Desktop.
Usage of ConstructorProperties annotation when removing setters and zero-args constructor
import java.beans.ConstructorProperties;
public class JacksonBean {
private final int value;
private final String another;
@ConstructorProperties({"value", "another"})
public JacksonBean(int value, 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