01: package org.contineo.core.security;
02:
03: import java.io.Serializable;
04: import java.util.Date;
05:
06: import org.apache.commons.lang.builder.ReflectionToStringBuilder;
07:
08: /**
09: * This is a mapper class for table userdoc.
10: *
11: * @author Michael Scholz
12: * @version 1.0
13: */
14: public class UserDoc implements Serializable {
15: private static final long serialVersionUID = 1L;
16:
17: private String timeStamp;
18:
19: private UserDocID id = new UserDocID(0, "");
20:
21: public UserDoc() {
22: timeStamp = String.valueOf(new Date().getTime());
23: }
24:
25: public String getUserName() {
26: return id.getUserName();
27: }
28:
29: public UserDocID getId() {
30: return id;
31: }
32:
33: public void setId(UserDocID id) {
34: this .id = id;
35: }
36:
37: public int getMenuId() {
38: return id.getMenuId();
39: }
40:
41: public String getTimeStamp() {
42: return timeStamp;
43: }
44:
45: public void setUserName(String uname) {
46: id.setUserName(uname);
47: }
48:
49: public void setMenuId(int id) {
50: this .id.setMenuId(id);
51: }
52:
53: public void setTimeStamp(String time) {
54: timeStamp = time;
55: }
56:
57: public String toString() {
58: // return ReflectionToStringBuilder.toString(this);
59: return (new ReflectionToStringBuilder(this ) {
60: protected boolean accept(java.lang.reflect.Field f) {
61: return super .accept(f);
62: } // end method accept
63: }).toString();
64: }
65:
66: @Override
67: public boolean equals(Object obj) {
68: if (!(obj instanceof UserDoc))
69: return false;
70: UserDoc other = (UserDoc) obj;
71: return other.getId().equals(other.getId());
72: }
73:
74: @Override
75: public int hashCode() {
76: return id.hashCode();
77: }
78: }
|