File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
src/main/java/guru/springframework/spring5webapp/model Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -40,4 +40,28 @@ public String getAddress() {
4040 public void setAddress (String address ) {
4141 this .address = address ;
4242 }
43+
44+ @ Override
45+ public boolean equals (Object o ) {
46+ if (this == o ) return true ;
47+ if (o == null || getClass () != o .getClass ()) return false ;
48+
49+ Publisher publisher = (Publisher ) o ;
50+
51+ return id != null ? id .equals (publisher .id ) : publisher .id == null ;
52+ }
53+
54+ @ Override
55+ public int hashCode () {
56+ return id != null ? id .hashCode () : 0 ;
57+ }
58+
59+ @ Override
60+ public String toString () {
61+ return "Publisher{" +
62+ "id=" + id +
63+ ", name='" + name + '\'' +
64+ ", address='" + address + '\'' +
65+ '}' ;
66+ }
4367}
You can’t perform that action at this time.
0 commit comments