1/*2* Licensed to the Apache Software Foundation (ASF) under one or more3* contributor license agreements. See the NOTICE file distributed with4* this work for additional information regarding copyright ownership.5* The ASF licenses this file to You under the Apache License, Version 2.06* (the "License"); you may not use this file except in compliance with7* the License. You may obtain a copy of the License at8*9* http://www.apache.org/licenses/LICENSE-2.010*11* Unless required by applicable law or agreed to in writing, software12* distributed under the License is distributed on an "AS IS" BASIS,13* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14* See the License for the specific language governing permissions and15* limitations under the License.16*/17/***18 * Created on Jan 13, 200419 *20 * 21 * @author22 */23packageorg.apache.jetspeed.deployment.simpleregistry;
2425import java.util.HashMap;
26import java.util.Map;
2728/***29 * <p>30 * Entry31 * </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 */38publicclassEntry39 {
40private String id;
41private Map attributes;
4243publicEntry()
44 {
45super();
46 attributes = new HashMap();
47 }
4849/***50 * @return51 */52public String getId()
53 {
54return id;
55 }
5657/***58 * @param string59 */60publicvoid setId(String string)
61 {
62 id = string;
63 }
6465public Object getAttribute(String key)
66 {
67return attributes.get(key);
68 }
6970publicvoid setAttribute(String key, Object value)
71 {
72 attributes.put(key, value);
73 }
7475/***76 * @see java.lang.Object#equals(java.lang.Object)77 */78publicboolean equals(Object obj)
79 {
80if(obj != null && obj instanceof Entry)
81 {
82 Entry entry = (Entry) obj;
83return entry.getId() != null && getId() != null && getId().equals(entry.getId());
84 }
8586return false;
87 }
8889/***90 * @see java.lang.Object#hashCode()91 */92publicint hashCode()
93 {
94return toString().hashCode();
95 }
9697public String toString()
98 {
99return getClass().toString().toString()+":"+getId();
100 }
101102103104 }