1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.apache.ws.scout.registry.infomodel; |
18 | |
|
19 | |
import java.util.Collection; |
20 | |
import java.util.Collections; |
21 | |
import java.util.HashSet; |
22 | |
|
23 | |
import javax.xml.registry.JAXRException; |
24 | |
import javax.xml.registry.infomodel.Slot; |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
public class SlotImpl implements Slot |
33 | |
{ |
34 | |
private String slotType; |
35 | |
private String name; |
36 | |
private Collection<String> values; |
37 | |
|
38 | |
@SuppressWarnings("unchecked") |
39 | |
public SlotImpl() |
40 | 0 | { |
41 | 0 | values = Collections.EMPTY_SET; |
42 | 0 | } |
43 | |
|
44 | |
public String getName() throws JAXRException |
45 | |
{ |
46 | 0 | return name; |
47 | |
} |
48 | |
|
49 | |
public String getSlotType() throws JAXRException |
50 | |
{ |
51 | 0 | return slotType; |
52 | |
} |
53 | |
|
54 | |
public Collection<String> getValues() throws JAXRException |
55 | |
{ |
56 | 0 | return values; |
57 | |
} |
58 | |
|
59 | |
public void setName(String s) throws JAXRException |
60 | |
{ |
61 | 0 | name = s; |
62 | 0 | } |
63 | |
|
64 | |
public void setSlotType(String s) throws JAXRException |
65 | |
{ |
66 | 0 | slotType = s; |
67 | 0 | } |
68 | |
|
69 | |
public void setValues(Collection collection) throws JAXRException |
70 | |
{ |
71 | 0 | if (collection == null) |
72 | |
{ |
73 | 0 | throw new IllegalArgumentException("values cannot be null"); |
74 | |
} |
75 | |
|
76 | |
|
77 | 0 | values = new HashSet<String>(collection); |
78 | 0 | } |
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
|
84 | |
|
85 | |
public boolean equals(Object o) |
86 | |
{ |
87 | 0 | if (this == o) return true; |
88 | 0 | if (!(o instanceof SlotImpl)) return false; |
89 | |
|
90 | 0 | final SlotImpl slot = (SlotImpl) o; |
91 | |
|
92 | 0 | if (name != null ? !name.equals(slot.name) : slot.name != null) return false; |
93 | |
|
94 | 0 | return true; |
95 | |
} |
96 | |
|
97 | |
public int hashCode() |
98 | |
{ |
99 | 0 | return (name != null ? name.hashCode() : 0); |
100 | |
} |
101 | |
} |
102 | |
|
103 | |
|