1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.betwixt;
19
20
21
22
23
24 public class BookBean {
25
26 private String author;
27 private String title;
28 private String publisher;
29
30 public BookBean() {}
31
32 public BookBean(String author, String title, String publisher) {
33 setAuthor(author);
34 setTitle(title);
35 setPublisher(publisher);
36 }
37
38 public String getAuthor() {
39 return author;
40 }
41
42 public String getPublisher() {
43 return publisher;
44 }
45
46 public String getTitle() {
47 return title;
48 }
49
50
51 public void setAuthor(String string) {
52 author = string;
53 }
54
55 public void setPublisher(String string) {
56 publisher = string;
57 }
58
59 public void setTitle(String string) {
60 title = string;
61 }
62
63 public boolean equals(Object obj) {
64 boolean result = false;
65 if (obj instanceof BookBean) {
66 BookBean book = (BookBean) obj;
67 result = author.equals(book.author) &&
68 publisher.equals(book.publisher) &&
69 title.equals(book.title);
70 }
71 return result;
72 }
73
74 public String toString() {
75 return "[BookBean title=" + title + "]";
76 }
77
78 }