1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      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://commons.apache.org/'>Apache Commons Team</a>
22   * @version $Revision: 561314 $
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  }