Skip to content

Commit

Permalink
2.2. Модель данных - Post. add link to equals and hashcode.
Browse files Browse the repository at this point in the history
  • Loading branch information
divergenny committed Jun 14, 2022
1 parent c214b02 commit 374a512
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/ru/job4j/grabber/models/Post.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Post post = (Post) o;
return id == post.id;
return id == post.id && Objects.equals(link, post.link);
}

@Override
public int hashCode() {
return Objects.hash(id);
return Objects.hash(id, link);
}

@Override
Expand Down

0 comments on commit 374a512

Please sign in to comment.