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: /**
20: * Author.
21: * @author Brautigam Robert
22: * @version Revision: $Revision$
23: */
24: public class Author implements Comparable {
25: private long persistenceId;
26: private String firstName;
27: private String lastName;
28:
29: public Author() {
30: }
31:
32: public Author(String firstName, String lastName) {
33: setFirstName(firstName);
34: setLastName(lastName);
35: }
36:
37: public String getFirstName() {
38: return firstName;
39: }
40:
41: public void setFirstName(String firstName) {
42: this .firstName = firstName;
43: }
44:
45: public String getLastName() {
46: return lastName;
47: }
48:
49: public void setLastName(String lastName) {
50: this .lastName = lastName;
51: }
52:
53: public String toString() {
54: return "[" + lastName + ", " + firstName + "]";
55: }
56:
57: public int compareTo(Object obj) {
58: return toString().compareTo(obj.toString());
59: }
60:
61: public boolean equals(Object rhs) {
62: if (!(rhs instanceof Author))
63: return false;
64: Author a = (Author) rhs;
65: return (firstName.equals(a.firstName))
66: && (lastName.equals(a.lastName));
67: }
68:
69: public long getPersistenceId() {
70: return persistenceId;
71: }
72:
73: public void setPersistenceId(long persistenceId) {
74: this.persistenceId = persistenceId;
75: }
76:
77: }
|