-
Notifications
You must be signed in to change notification settings - Fork 53.6k
Expand file tree
/
Copy pathArticle.java
More file actions
44 lines (34 loc) · 882 Bytes
/
Article.java
File metadata and controls
44 lines (34 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.baeldung.restclient;
import java.util.Objects;
public class Article {
Integer id;
String title;
public Article() {}
public Article(Integer id, String title) {
this.id = id;
this.title = title;
}
public Integer getId() {
return id;
}
public String getTitle() {
return title;
}
public void setId(Integer id) {
this.id = id;
}
public void setTitle(String title) {
this.title = title;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Article article = (Article) o;
return Objects.equals(id, article.id) && Objects.equals(title, article.title);
}
@Override
public int hashCode() {
return Objects.hash(id, title);
}
}