Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
KeyImpl |
|
| 1.8571428571428572;1.857 |
1 | /* | |
2 | * Copyright 2001-2004 The Apache Software Foundation. | |
3 | * | |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | * | |
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 | { | |
29 | private String id; | |
30 | ||
31 | public KeyImpl() | |
32 | 0 | { |
33 | 0 | } |
34 | ||
35 | public KeyImpl(String id) | |
36 | 0 | { |
37 | 0 | this.id = id; |
38 | 0 | } |
39 | ||
40 | public String getId() | |
41 | { | |
42 | 0 | return id; |
43 | } | |
44 | ||
45 | public void setId(String str) | |
46 | { | |
47 | 0 | this.id = str; |
48 | 0 | } |
49 | ||
50 | public boolean equals(Object o) | |
51 | { | |
52 | 0 | if (this == o) return true; |
53 | 0 | if (!(o instanceof KeyImpl)) return false; |
54 | 0 | final KeyImpl key = (KeyImpl) o; |
55 | 0 | if (id != null ? !id.equals(key.id) : key.id != null) return false; |
56 | 0 | return true; |
57 | } | |
58 | ||
59 | public int hashCode() | |
60 | { | |
61 | 0 | return (id != null ? id.hashCode() : 0); |
62 | } | |
63 | ||
64 | public String toString() | |
65 | { | |
66 | 0 | return id; |
67 | } | |
68 | } |