1 22 package test.net.sf.anupam.csv.beans; 23 24 import org.apache.commons.lang.builder.CompareToBuilder; 25 import org.apache.commons.lang.builder.EqualsBuilder; 26 import org.apache.commons.lang.builder.HashCodeBuilder; 27 import org.apache.commons.lang.builder.ToStringBuilder; 28 29 36 public class Employee 37 implements Comparable <Employee> { 38 41 44 private String employeeID; 45 46 49 private String firstName; 50 51 54 private String lastName; 55 56 59 private String clientSuppliedID; 60 61 64 private String clientSuppliedSecondaryID; 65 66 69 private Designation designation; 70 71 74 public Employee() { 75 super(); 76 } 77 78 84 public String getClientSuppliedID() { 85 return this.clientSuppliedID; 86 } 87 88 93 public void setClientSuppliedID(final String clientSuppliedID) { 94 this.clientSuppliedID = clientSuppliedID; 95 } 96 97 103 public String getClientSuppliedSecondaryID() { 104 return this.clientSuppliedSecondaryID; 105 } 106 107 112 public void setClientSuppliedSecondaryID( 113 final String clientSuppliedSecondaryID) { 114 this.clientSuppliedSecondaryID = clientSuppliedSecondaryID; 115 } 116 117 122 public void setEmployeeID(final String employeeID) { 123 this.employeeID = employeeID; 124 } 125 126 132 public String getEmployeeID() { 133 return this.employeeID; 134 } 135 136 141 public void setFirstName(final String firstName) { 142 this.firstName = firstName; 143 } 144 145 151 public String getFirstName() { 152 return this.firstName; 153 } 154 155 160 public void setLastName(final String lastName) { 161 this.lastName = lastName; 162 } 163 164 170 public String getLastName() { 171 return this.lastName; 172 } 173 174 183 public int compareTo(final Employee other) { 184 185 return new CompareToBuilder().append(employeeID, other.employeeID) 186 .toComparison(); 187 } 188 189 197 @Override 198 public boolean equals(final Object other) { 199 if (this == other) { 200 return true; 201 } 202 203 if (!(other instanceof Employee)) { 204 return false; 205 } 206 207 final Employee castOther = (Employee) other; 208 209 return new EqualsBuilder().append(employeeID, castOther.employeeID) 210 .isEquals(); 211 } 212 213 219 @Override 220 public int hashCode() { 221 return new HashCodeBuilder().append(employeeID).toHashCode(); 222 } 223 224 231 @Override 232 public String toString() { 233 return new ToStringBuilder(this).append("employeeID", employeeID) 234 .append("firstName", firstName).append("lastName", lastName) 235 .append("clientSuppliedID", clientSuppliedID).append( 236 "clientSuppliedSecondayID", clientSuppliedSecondaryID) 237 .append("designation", designation).toString(); 238 } 239 240 246 public Designation getDesignation() { 247 return this.designation; 248 } 249 250 255 public void setDesignation(final Designation designation) { 256 this.designation = designation; 257 } 258 } 259 | Popular Tags |