Skip to content

Instantly share code, notes, and snippets.

@Jian-Min-Huang
Created May 19, 2021 09:09
Show Gist options
  • Select an option

  • Save Jian-Min-Huang/0169f73244860c7a3e7ce4cc5d6aac16 to your computer and use it in GitHub Desktop.

Select an option

Save Jian-Min-Huang/0169f73244860c7a3e7ce4cc5d6aac16 to your computer and use it in GitHub Desktop.
public class Response {
private String code;
private Map<String, Object> data;
private Long timestamp;
private String checksum;
public Response(String code, Map<String, Object> data, Long timestamp, String checksum) {
this.code = code;
this.data = data;
this.timestamp = timestamp;
this.checksum = checksum;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Map<String, Object> getData() {
return data;
}
public void setData(Map<String, Object> data) {
this.data = data;
}
public Long getTimestamp() {
return timestamp;
}
public void setTimestamp(Long timestamp) {
this.timestamp = timestamp;
}
public String getChecksum() {
return checksum;
}
public void setChecksum(String checksum) {
this.checksum = checksum;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Response response = (Response) o;
if (code != null ? !code.equals(response.code) : response.code != null) return false;
if (data != null ? !data.equals(response.data) : response.data != null) return false;
if (timestamp != null ? !timestamp.equals(response.timestamp) : response.timestamp != null) return false;
return checksum != null ? checksum.equals(response.checksum) : response.checksum == null;
}
@Override
public int hashCode() {
int result = code != null ? code.hashCode() : 0;
result = 31 * result + (data != null ? data.hashCode() : 0);
result = 31 * result + (timestamp != null ? timestamp.hashCode() : 0);
result = 31 * result + (checksum != null ? checksum.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "Response{" +
"code='" + code + '\'' +
", data=" + data +
", timestamp=" + timestamp +
", checksum='" + checksum + '\'' +
'}';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment