1
2
3
4
5
6
7 package BusinessDomainDsl.impl;
8
9 import BusinessDomainDsl.BusinessDomainDslPackage;
10 import BusinessDomainDsl.Property;
11 import BusinessDomainDsl.UniqueRule;
12
13 import java.util.Collection;
14
15 import org.eclipse.emf.common.util.EList;
16
17 import org.eclipse.emf.ecore.EClass;
18
19 import org.eclipse.emf.ecore.util.EObjectResolvingEList;
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 public class UniqueRuleImpl extends AbstractBusinessRuleImpl implements UniqueRule {
35
36
37
38
39
40
41
42
43 protected EList<Property> properties;
44
45
46
47
48
49
50 protected UniqueRuleImpl() {
51 super();
52 }
53
54
55
56
57
58
59 @Override
60 protected EClass eStaticClass() {
61 return BusinessDomainDslPackage.Literals.UNIQUE_RULE;
62 }
63
64
65
66
67
68
69 public EList<Property> getProperties() {
70 if (properties == null) {
71 properties = new EObjectResolvingEList<Property>(Property.class, this, BusinessDomainDslPackage.UNIQUE_RULE__PROPERTIES);
72 }
73 return properties;
74 }
75
76
77
78
79
80
81 @Override
82 public Object eGet(int featureID, boolean resolve, boolean coreType) {
83 switch (featureID) {
84 case BusinessDomainDslPackage.UNIQUE_RULE__PROPERTIES:
85 return getProperties();
86 }
87 return super.eGet(featureID, resolve, coreType);
88 }
89
90
91
92
93
94
95 @SuppressWarnings("unchecked")
96 @Override
97 public void eSet(int featureID, Object newValue) {
98 switch (featureID) {
99 case BusinessDomainDslPackage.UNIQUE_RULE__PROPERTIES:
100 getProperties().clear();
101 getProperties().addAll((Collection<? extends Property>)newValue);
102 return;
103 }
104 super.eSet(featureID, newValue);
105 }
106
107
108
109
110
111
112 @Override
113 public void eUnset(int featureID) {
114 switch (featureID) {
115 case BusinessDomainDslPackage.UNIQUE_RULE__PROPERTIES:
116 getProperties().clear();
117 return;
118 }
119 super.eUnset(featureID);
120 }
121
122
123
124
125
126
127 @Override
128 public boolean eIsSet(int featureID) {
129 switch (featureID) {
130 case BusinessDomainDslPackage.UNIQUE_RULE__PROPERTIES:
131 return properties != null && !properties.isEmpty();
132 }
133 return super.eIsSet(featureID);
134 }
135
136 }