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