Skip to content

Instantly share code, notes, and snippets.

@donchan922
Last active May 18, 2019 12:17
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 donchan922/60524ab654fd1f60727fab87d71e4e89 to your computer and use it in GitHub Desktop.
Save donchan922/60524ab654fd1f60727fab87d71e4e89 to your computer and use it in GitHub Desktop.
// レスポンスの中に定義したフィールド以外の項目があっても無視する
@JsonIgnoreProperties(ignoreUnknown = true)
public class Value {
private Long id;
private String quote;
// 引数なしのコンストラクタを定義しないとデシリアライズ(JSON -> Javaオブジェクトへの変換)時にエラーが起きる
public Value() {
}
public Long getId() {
return this.id;
}
public String getQuote() {
return this.quote;
}
public void setId(Long id) {
this.id = id;
}
public void setQuote(String quote) {
this.quote = quote;
}
@Override
public String toString() {
return "Value{" +
"id=" + id +
", quote='" + quote + '\'' +
'}';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment