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: package org.apache.cocoon.components.repository.helpers;
18:
19: /**
20: * A PropertyName object intentifies a specific property.
21: */
22: public class PropertyName {
23:
24: private String name;
25: private String namespace;
26:
27: /**
28: * creates a PropertyName
29: *
30: * @param name the name of the property.
31: * @param namespace the namespace of the property.
32: */
33: public PropertyName(String name, String namespace) {
34: this .name = name;
35: this .namespace = namespace;
36: }
37:
38: /**
39: * get the name of the property
40: *
41: * @return the name of the property.
42: */
43: public String getName() {
44: return this .name;
45: }
46:
47: /**
48: * get the namespace of the property
49: *
50: * @return the namespace of the property.
51: */
52: public String getNamespace() {
53: return this .namespace;
54: }
55:
56: /* (non-Javadoc)
57: * @see java.lang.Object#hashCode()
58: */
59: public int hashCode() {
60: return (this .namespace + ":" + this .name).hashCode();
61: }
62:
63: /* (non-Javadoc)
64: * @see java.lang.Object#equals(java.lang.Object)
65: */
66: public boolean equals(Object obj) {
67: return (obj != null && (obj instanceof PropertyName)
68: && this .name.equals(((PropertyName) obj).getName()) && this .namespace
69: .equals(((PropertyName) obj).getNamespace()));
70: }
71:
72: }
|