1 package com.dotmarketing.portlets.events.model; 2 3 import java.io.Serializable ; 4 import java.util.Date ; 5 6 import org.apache.commons.lang.builder.EqualsBuilder; 7 import org.apache.commons.lang.builder.HashCodeBuilder; 8 import com.dotmarketing.beans.*; 9 10 11 public class EventRegistration extends Inode implements Serializable , Comparable { 12 13 14 private long inode; 15 16 Date registrationDate; 17 private String fullName; 18 int numberAttending; 19 private String comments; 20 21 22 private String email; 23 24 25 public EventRegistration() { 26 super.setType("event_registration"); 27 registrationDate = new Date (); 28 } 29 30 31 public boolean equals(Object 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 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 getComments() { 58 return comments; 59 } 60 61 62 public void setComments(String comments) { 63 this.comments = comments; 64 } 65 66 67 public String getEmail() { 68 return email; 69 } 70 71 72 public void setEmail(String email) { 73 this.email = email; 74 } 75 76 77 public String getFullName() { 78 return fullName; 79 } 80 81 82 public void setFullName(String 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 getRegistrationDate() { 108 return registrationDate; 109 } 110 111 112 public void setRegistrationDate(Date registrationDate) { 113 this.registrationDate = registrationDate; 114 } 115 116 } 117 | Popular Tags |