01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package org.apache.commons.betwixt;
19:
20: /**
21: * @author <a href='http://jakarta.apache.org/'>Jakarta Commons Team</a>
22: * @version $Revision: 438373 $
23: */
24: public class BookBean {
25:
26: private String author;
27: private String title;
28: private String publisher;
29:
30: public BookBean() {
31: }
32:
33: public BookBean(String author, String title, String publisher) {
34: setAuthor(author);
35: setTitle(title);
36: setPublisher(publisher);
37: }
38:
39: public String getAuthor() {
40: return author;
41: }
42:
43: public String getPublisher() {
44: return publisher;
45: }
46:
47: public String getTitle() {
48: return title;
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: }
|