1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package net.ramapuram.thomas.model.opac;
19
20 import net.ramapuram.thomas.model.BaseObject;
21 import net.ramapuram.thomas.model.User;
22 import net.ramapuram.thomas.model.acquisition.Book;
23
24 import java.util.Date;
25
26
27
28
29
30
31 public class Comment extends BaseObject {
32 private Long id;
33 private User user;
34 private String comment;
35 private Date enteredOn;
36 private Book book;
37
38 public Long getId() {
39 return id;
40 }
41
42 public void setId(Long id) {
43 this.id = id;
44 }
45
46 public User getUser() {
47 return user;
48 }
49
50 public void setUser(User user) {
51 this.user = user;
52 }
53
54 public String getComment() {
55 return comment;
56 }
57
58 public void setComment(String comment) {
59 this.comment = comment;
60 }
61
62 public Date getEnteredOn() {
63 return enteredOn;
64 }
65
66 public void setEnteredOn(Date enteredOn) {
67 this.enteredOn = enteredOn;
68 }
69
70 public Book getBook() {
71 return book;
72 }
73
74 public void setBook(Book book) {
75 this.book = book;
76 }
77
78 @Override
79 public boolean equals(Object o) {
80 if (this == o) return true;
81 if (o == null || getClass() != o.getClass()) return false;
82
83 Comment comment1 = (Comment) o;
84
85 if (book != null ? !book.equals(comment1.book) : comment1.book != null) return false;
86 if (comment != null ? !comment.equals(comment1.comment) : comment1.comment != null) return false;
87 if (enteredOn != null ? !enteredOn.equals(comment1.enteredOn) : comment1.enteredOn != null) return false;
88 if (id != null ? !id.equals(comment1.id) : comment1.id != null) return false;
89 if (user != null ? !user.equals(comment1.user) : comment1.user != null) return false;
90
91 return true;
92 }
93
94 @Override
95 public int hashCode() {
96 int result = id != null ? id.hashCode() : 0;
97 result = 31 * result + (user != null ? user.hashCode() : 0);
98 result = 31 * result + (comment != null ? comment.hashCode() : 0);
99 result = 31 * result + (enteredOn != null ? enteredOn.hashCode() : 0);
100 result = 31 * result + (book != null ? book.hashCode() : 0);
101 return result;
102 }
103
104 @Override
105 public String toString() {
106 return "Comment{" +
107 "id=" + id +
108 ", user=" + user +
109 ", comment='" + comment + '\'' +
110 ", enteredOn=" + enteredOn +
111 ", book=" + book +
112 '}';
113 }
114 }