a b/src/main/java/genericbcm/impl/SupportResourceToResourceLinkImpl.java
1
/**
2
 */
3
package genericbcm.impl;
4
5
import genericbcm.GenericbcmPackage;
6
import genericbcm.Resource;
7
import genericbcm.SupportResource;
8
import genericbcm.SupportResourceToResourceLink;
9
10
import org.eclipse.emf.common.notify.Notification;
11
12
import org.eclipse.emf.ecore.EClass;
13
import org.eclipse.emf.ecore.InternalEObject;
14
15
import org.eclipse.emf.ecore.impl.ENotificationImpl;
16
17
/**
18
 * <!-- begin-user-doc -->
19
 * An implementation of the model object '<em><b>Support Resource To Resource Link</b></em>'.
20
 * <!-- end-user-doc -->
21
 * <p>
22
 * The following features are implemented:
23
 * <ul>
24
 *   <li>{@link genericbcm.impl.SupportResourceToResourceLinkImpl#getFrom <em>From</em>}</li>
25
 *   <li>{@link genericbcm.impl.SupportResourceToResourceLinkImpl#getTo <em>To</em>}</li>
26
 * </ul>
27
 * </p>
28
 *
29
 * @generated
30
 */
31
public class SupportResourceToResourceLinkImpl extends NameableImpl implements SupportResourceToResourceLink {
32
  /**
33
   * The cached value of the '{@link #getFrom() <em>From</em>}' reference.
34
   * <!-- begin-user-doc -->
35
   * <!-- end-user-doc -->
36
   * @see #getFrom()
37
   * @generated
38
   * @ordered
39
   */
40
  protected SupportResource from;
41
42
  /**
43
   * The cached value of the '{@link #getTo() <em>To</em>}' reference.
44
   * <!-- begin-user-doc -->
45
   * <!-- end-user-doc -->
46
   * @see #getTo()
47
   * @generated
48
   * @ordered
49
   */
50
  protected Resource to;
51
52
  /**
53
   * <!-- begin-user-doc -->
54
   * <!-- end-user-doc -->
55
   * @generated
56
   */
57
  protected SupportResourceToResourceLinkImpl() {
58
      super();
59
  }
60
61
  /**
62
   * <!-- begin-user-doc -->
63
   * <!-- end-user-doc -->
64
   * @generated
65
   */
66
  @Override
67
  protected EClass eStaticClass() {
68
      return GenericbcmPackage.Literals.SUPPORT_RESOURCE_TO_RESOURCE_LINK;
69
  }
70
71
  /**
72
   * <!-- begin-user-doc -->
73
   * <!-- end-user-doc -->
74
   * @generated
75
   */
76
  public SupportResource getFrom() {
77
      if (from != null && from.eIsProxy()) {
78
          InternalEObject oldFrom = (InternalEObject)from;
79
          from = (SupportResource)eResolveProxy(oldFrom);
80
          if (from != oldFrom) {
81
              if (eNotificationRequired())
82
                  eNotify(new ENotificationImpl(this, Notification.RESOLVE, GenericbcmPackage.SUPPORT_RESOURCE_TO_RESOURCE_LINK__FROM, oldFrom, from));
83
          }
84
      }
85
      return from;
86
  }
87
88
  /**
89
   * <!-- begin-user-doc -->
90
   * <!-- end-user-doc -->
91
   * @generated
92
   */
93
  public SupportResource basicGetFrom() {
94
      return from;
95
  }
96
97
  /**
98
   * <!-- begin-user-doc -->
99
   * <!-- end-user-doc -->
100
   * @generated
101
   */
102
  public void setFrom(SupportResource newFrom) {
103
      SupportResource oldFrom = from;
104
      from = newFrom;
105
      if (eNotificationRequired())
106
          eNotify(new ENotificationImpl(this, Notification.SET, GenericbcmPackage.SUPPORT_RESOURCE_TO_RESOURCE_LINK__FROM, oldFrom, from));
107
  }
108
109
  /**
110
   * <!-- begin-user-doc -->
111
   * <!-- end-user-doc -->
112
   * @generated
113
   */
114
  public Resource getTo() {
115
      if (to != null && to.eIsProxy()) {
116
          InternalEObject oldTo = (InternalEObject)to;
117
          to = (Resource)eResolveProxy(oldTo);
118
          if (to != oldTo) {
119
              if (eNotificationRequired())
120
                  eNotify(new ENotificationImpl(this, Notification.RESOLVE, GenericbcmPackage.SUPPORT_RESOURCE_TO_RESOURCE_LINK__TO, oldTo, to));
121
          }
122
      }
123
      return to;
124
  }
125
126
  /**
127
   * <!-- begin-user-doc -->
128
   * <!-- end-user-doc -->
129
   * @generated
130
   */
131
  public Resource basicGetTo() {
132
      return to;
133
  }
134
135
  /**
136
   * <!-- begin-user-doc -->
137
   * <!-- end-user-doc -->
138
   * @generated
139
   */
140
  public void setTo(Resource newTo) {
141
      Resource oldTo = to;
142
      to = newTo;
143
      if (eNotificationRequired())
144
          eNotify(new ENotificationImpl(this, Notification.SET, GenericbcmPackage.SUPPORT_RESOURCE_TO_RESOURCE_LINK__TO, oldTo, to));
145
  }
146
147
  /**
148
   * <!-- begin-user-doc -->
149
   * <!-- end-user-doc -->
150
   * @generated
151
   */
152
  @Override
153
  public Object eGet(int featureID, boolean resolve, boolean coreType) {
154
      switch (featureID) {
155
          case GenericbcmPackage.SUPPORT_RESOURCE_TO_RESOURCE_LINK__FROM:
156
              if (resolve) return getFrom();
157
              return basicGetFrom();
158
          case GenericbcmPackage.SUPPORT_RESOURCE_TO_RESOURCE_LINK__TO:
159
              if (resolve) return getTo();
160
              return basicGetTo();
161
      }
162
      return super.eGet(featureID, resolve, coreType);
163
  }
164
165
  /**
166
   * <!-- begin-user-doc -->
167
   * <!-- end-user-doc -->
168
   * @generated
169
   */
170
  @Override
171
  public void eSet(int featureID, Object newValue) {
172
      switch (featureID) {
173
          case GenericbcmPackage.SUPPORT_RESOURCE_TO_RESOURCE_LINK__FROM:
174
              setFrom((SupportResource)newValue);
175
              return;
176
          case GenericbcmPackage.SUPPORT_RESOURCE_TO_RESOURCE_LINK__TO:
177
              setTo((Resource)newValue);
178
              return;
179
      }
180
      super.eSet(featureID, newValue);
181
  }
182
183
  /**
184
   * <!-- begin-user-doc -->
185
   * <!-- end-user-doc -->
186
   * @generated
187
   */
188
  @Override
189
  public void eUnset(int featureID) {
190
      switch (featureID) {
191
          case GenericbcmPackage.SUPPORT_RESOURCE_TO_RESOURCE_LINK__FROM:
192
              setFrom((SupportResource)null);
193
              return;
194
          case GenericbcmPackage.SUPPORT_RESOURCE_TO_RESOURCE_LINK__TO:
195
              setTo((Resource)null);
196
              return;
197
      }
198
      super.eUnset(featureID);
199
  }
200
201
  /**
202
   * <!-- begin-user-doc -->
203
   * <!-- end-user-doc -->
204
   * @generated
205
   */
206
  @Override
207
  public boolean eIsSet(int featureID) {
208
      switch (featureID) {
209
          case GenericbcmPackage.SUPPORT_RESOURCE_TO_RESOURCE_LINK__FROM:
210
              return from != null;
211
          case GenericbcmPackage.SUPPORT_RESOURCE_TO_RESOURCE_LINK__TO:
212
              return to != null;
213
      }
214
      return super.eIsSet(featureID);
215
  }
216
217
} //SupportResourceToResourceLinkImpl