01: package org.contineo.core.security;
02:
03: import java.io.Serializable;
04:
05: /**
06: * Identifier of <code>UserDoc</code>
07: *
08: * @author Marco Meschieri
09: * @version $Id: UserDocID.java,v 1.1 2007/06/29 06:28:29 marco Exp $
10: * @since 3.0
11: */
12: public class UserDocID implements Serializable {
13:
14: private static final long serialVersionUID = 1L;
15:
16: private String userName;
17:
18: private int menuId;
19:
20: public UserDocID() {
21: }
22:
23: public UserDocID(int menuId, String userName) {
24: super ();
25: this .userName = userName;
26: this .menuId = menuId;
27: }
28:
29: public int getMenuId() {
30: return menuId;
31: }
32:
33: public void setMenuId(int menuId) {
34: this .menuId = menuId;
35: }
36:
37: public String getUserName() {
38: return userName;
39: }
40:
41: public void setUserName(String userName) {
42: this .userName = userName;
43: }
44:
45: @Override
46: public boolean equals(Object obj) {
47: if (!(obj instanceof UserDocID))
48: return false;
49:
50: UserDocID other = (UserDocID) obj;
51: if (other.getMenuId() != this .getMenuId())
52: return false;
53: return other.getUserName().equals(this .getUserName());
54: }
55:
56: @Override
57: public int hashCode() {
58: return (getUserName() + getMenuId()).hashCode();
59: }
60: }
|