1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 /***
18 * Created on Jan 13, 2004
19 *
20 *
21 * @author
22 */
23 package org.apache.jetspeed.deployment.simpleregistry;
24
25 import java.util.HashMap;
26 import java.util.Map;
27
28 /***
29 * <p>
30 * Entry
31 * </p>
32 * Simple data type representing some regitered resource.
33 *
34 * @author <a href="mailto:weaver@apache.org">Scott T. Weaver</a>
35 * @version $Id: Entry.java 516881 2007-03-11 10:34:21Z ate $
36 *
37 */
38 public class Entry
39 {
40 private String id;
41 private Map attributes;
42
43 public Entry()
44 {
45 super();
46 attributes = new HashMap();
47 }
48
49 /***
50 * @return
51 */
52 public String getId()
53 {
54 return id;
55 }
56
57 /***
58 * @param string
59 */
60 public void setId(String string)
61 {
62 id = string;
63 }
64
65 public Object getAttribute(String key)
66 {
67 return attributes.get(key);
68 }
69
70 public void setAttribute(String key, Object value)
71 {
72 attributes.put(key, value);
73 }
74
75 /***
76 * @see java.lang.Object#equals(java.lang.Object)
77 */
78 public boolean equals(Object obj)
79 {
80 if(obj != null && obj instanceof Entry)
81 {
82 Entry entry = (Entry) obj;
83 return entry.getId() != null && getId() != null && getId().equals(entry.getId());
84 }
85
86 return false;
87 }
88
89 /***
90 * @see java.lang.Object#hashCode()
91 */
92 public int hashCode()
93 {
94 return toString().hashCode();
95 }
96
97 public String toString()
98 {
99 return getClass().toString().toString()+":"+getId();
100 }
101
102
103
104 }