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