01: /*
02: * Copyright 2001-2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.ws.scout.registry.infomodel;
18:
19: import javax.xml.registry.infomodel.Key;
20:
21: /**
22: * Implements JAXR Interface.
23: * For futher details, look into the JAXR API Javadoc.
24: *
25: * @author Anil Saldhana <anil@apache.org>
26: */
27: public class KeyImpl implements Key {
28: private String id;
29:
30: public KeyImpl() {
31: }
32:
33: public KeyImpl(String id) {
34: this .id = id;
35: }
36:
37: public String getId() {
38: return id;
39: }
40:
41: public void setId(String str) {
42: this .id = str;
43: }
44:
45: public boolean equals(Object o) {
46: if (this == o)
47: return true;
48: if (!(o instanceof KeyImpl))
49: return false;
50: final KeyImpl key = (KeyImpl) o;
51: if (id != null ? !id.equals(key.id) : key.id != null)
52: return false;
53: return true;
54: }
55:
56: public int hashCode() {
57: return (id != null ? id.hashCode() : 0);
58: }
59:
60: public String toString() {
61: return id;
62: }
63: }
|