01: /*
02: * Lucane - a collaborative platform
03: * Copyright (C) 2003 Vincent Fiack <vfiack@mail15.com>
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2.1 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: */
19:
20: package org.lucane.applications.calendar;
21:
22: import java.io.*;
23:
24: public class Attendee implements Serializable {
25: //-- status
26: public static final int STATUS_UNKNOWN = 0;
27: public static final int STATUS_ACCEPTED = 1;
28: public static final int STATUS_REFUSED = 2;
29:
30: //-- attributes
31: private String user;
32: private boolean mandatory;
33: private int status;
34:
35: public Attendee(String user, boolean mandatory, int status) {
36: this .user = user;
37: this .mandatory = mandatory;
38: this .status = status;
39: }
40:
41: public Attendee(String user, boolean mandatory) {
42: this (user, mandatory, Attendee.STATUS_UNKNOWN);
43: }
44:
45: //-- setters
46: public void setStatus(int status) {
47: this .status = status;
48: }
49:
50: //-- getters
51: public String getUser() {
52: return this .user;
53: }
54:
55: public boolean isMandatory() {
56: return this .mandatory;
57: }
58:
59: public int getStatus() {
60: return this .status;
61: }
62:
63: public boolean equals(Object o) {
64: if (o instanceof Attendee) {
65: Attendee a = (Attendee) o;
66: return a.getUser().equals(getUser());
67: }
68: return false;
69: }
70:
71: public int hashCode() {
72: return getUser().hashCode();
73: }
74: }
|