01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * 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 and
15: * limitations under the License.
16: */
17:
18: package org.apache.naming;
19:
20: /**
21: * Represents a binding in a NamingContext.
22: *
23: * @author Remy Maucherat
24: * @version $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $
25: */
26:
27: public class NamingEntry {
28:
29: // -------------------------------------------------------------- Constants
30:
31: public static final int ENTRY = 0;
32: public static final int LINK_REF = 1;
33: public static final int REFERENCE = 2;
34:
35: public static final int CONTEXT = 10;
36:
37: // ----------------------------------------------------------- Constructors
38:
39: public NamingEntry(String name, Object value, int type) {
40: this .name = name;
41: this .value = value;
42: this .type = type;
43: }
44:
45: // ----------------------------------------------------- Instance Variables
46:
47: /**
48: * The type instance variable is used to avoid unsing RTTI when doing
49: * lookups.
50: */
51: public int type;
52: public String name;
53: public Object value;
54:
55: // --------------------------------------------------------- Object Methods
56:
57: public boolean equals(Object obj) {
58: if ((obj != null) && (obj instanceof NamingEntry)) {
59: return name.equals(((NamingEntry) obj).name);
60: } else {
61: return false;
62: }
63: }
64:
65: public int hashCode() {
66: return name.hashCode();
67: }
68:
69: }
|