01: /**
02: * Copyright (C) 2006 NetMind Consulting Bt.
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 3 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */package hu.netmind.persistence;
18:
19: import java.util.List;
20:
21: /**
22: * Book class.
23: * @author Brautigam Robert
24: * @version Revision: $Revision$
25: */
26: public class Book {
27: private String title;
28: private String isbn;
29: private List authors;
30: private Author mainAuthor;
31:
32: public Book() {
33: }
34:
35: public Book(String title, String isbn) {
36: setTitle(title);
37: setIsbn(isbn);
38: }
39:
40: public String getTitle() {
41: return title;
42: }
43:
44: public void setTitle(String title) {
45: this .title = title;
46: }
47:
48: public String getIsbn() {
49: return isbn;
50: }
51:
52: public void setIsbn(String isbn) {
53: this .isbn = isbn;
54: }
55:
56: public List getAuthors() {
57: return authors;
58: }
59:
60: public void setAuthors(List authors) {
61: this .authors = authors;
62: }
63:
64: public Author getMainAuthor() {
65: return mainAuthor;
66: }
67:
68: public void setMainAuthor(Author mainAuthor) {
69: this .mainAuthor = mainAuthor;
70: }
71:
72: public String toString() {
73: return "[Book: " + title + " (" + isbn + "), author: "
74: + mainAuthor + "]";
75: }
76:
77: public boolean equals(Object rhs) {
78: if (!(rhs instanceof Book))
79: return false;
80: Book b = (Book) rhs;
81: return (((title == null) && (b.title == null)) || ((title != null) && (title
82: .equals(b.title))))
83: && (((isbn == null) && (b.isbn == null)) || ((isbn != null) && (isbn
84: .equals(b.isbn))));
85: }
86: }
|