KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > dotmarketing > portlets > events > model > EventRegistration


1 package com.dotmarketing.portlets.events.model;
2
3 import java.io.Serializable JavaDoc;
4 import java.util.Date JavaDoc;
5
6 import org.apache.commons.lang.builder.EqualsBuilder;
7 import org.apache.commons.lang.builder.HashCodeBuilder;
8 import com.dotmarketing.beans.*;
9
10 /** @author David Torres */
11 public class EventRegistration extends Inode implements Serializable JavaDoc, Comparable JavaDoc{
12     
13     /** identifier field */
14     private long inode;
15
16     Date JavaDoc registrationDate;
17     private String JavaDoc fullName;
18     int numberAttending;
19     private String JavaDoc comments;
20
21     /** nullable persistent field */
22     private String JavaDoc email;
23     
24     /** default constructor */
25     public EventRegistration() {
26         super.setType("event_registration");
27         registrationDate = new Date JavaDoc();
28     }
29
30     
31     public boolean equals(Object JavaDoc other) {
32         if ( !(other instanceof EventRegistration) ) return false;
33         EventRegistration castOther = (EventRegistration) other;
34         return new EqualsBuilder()
35         .append(this.getInode(), castOther.getInode())
36         .isEquals();
37     }
38     
39     public int compareTo(Object JavaDoc other) {
40         if ( !(other instanceof EventRegistration) ) return 0;
41         EventRegistration castOther = (EventRegistration) other;
42         
43         if (this.getRegistrationDate().before(castOther.getRegistrationDate())) return -1;
44         if(this.getRegistrationDate().after(castOther.getRegistrationDate())) return 0;
45         
46         return 0;
47         
48     }
49     
50     public int hashCode() {
51         return new HashCodeBuilder()
52         .append(getInode())
53         .toHashCode();
54     }
55
56
57     public String JavaDoc getComments() {
58         return comments;
59     }
60
61
62     public void setComments(String JavaDoc comments) {
63         this.comments = comments;
64     }
65
66
67     public String JavaDoc getEmail() {
68         return email;
69     }
70
71
72     public void setEmail(String JavaDoc email) {
73         this.email = email;
74     }
75
76
77     public String JavaDoc getFullName() {
78         return fullName;
79     }
80
81
82     public void setFullName(String JavaDoc fullName) {
83         this.fullName = fullName;
84     }
85
86
87     public long getInode() {
88         return inode;
89     }
90
91
92     public void setInode(long inode) {
93         this.inode = inode;
94     }
95
96
97     public int getNumberAttending() {
98         return numberAttending;
99     }
100
101
102     public void setNumberAttending(int numberAttending) {
103         this.numberAttending = numberAttending;
104     }
105
106
107     public Date JavaDoc getRegistrationDate() {
108         return registrationDate;
109     }
110
111
112     public void setRegistrationDate(Date JavaDoc registrationDate) {
113         this.registrationDate = registrationDate;
114     }
115     
116 }
117
Popular Tags