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 {
41 values = Collections.EMPTY_SET;
42 }
43
44 public String getName() throws JAXRException
45 {
46 return name;
47 }
48
49 public String getSlotType() throws JAXRException
50 {
51 return slotType;
52 }
53
54 public Collection<String> getValues() throws JAXRException
55 {
56 return values;
57 }
58
59 public void setName(String s) throws JAXRException
60 {
61 name = s;
62 }
63
64 public void setSlotType(String s) throws JAXRException
65 {
66 slotType = s;
67 }
68
69 public void setValues(Collection collection) throws JAXRException
70 {
71 if (collection == null)
72 {
73 throw new IllegalArgumentException("values cannot be null");
74 }
75
76
77 values = new HashSet<String>(collection);
78 }
79
80
81
82
83
84
85 public boolean equals(Object o)
86 {
87 if (this == o) return true;
88 if (!(o instanceof SlotImpl)) return false;
89
90 final SlotImpl slot = (SlotImpl) o;
91
92 if (name != null ? !name.equals(slot.name) : slot.name != null) return false;
93
94 return true;
95 }
96
97 public int hashCode()
98 {
99 return (name != null ? name.hashCode() : 0);
100 }
101 }
102
103