Modify pom file
[nemo.git] / nemo-tools / eclipse-plugin / nemo-editor / org.opendaylight.nemo.tool.eclipse.plugin.editor / src-gen / org / opendaylight / nemo / tool / eclipse / plugin / editor / impl / OperationImpl.java
1 /**
2  */
3 package org.opendaylight.nemo.tool.eclipse.plugin.editor.impl;
4
5 import java.util.Collection;
6
7 import org.eclipse.emf.common.notify.Notification;
8
9 import org.eclipse.emf.common.util.EList;
10
11 import org.eclipse.emf.ecore.EClass;
12 import org.eclipse.emf.ecore.InternalEObject;
13
14 import org.eclipse.emf.ecore.impl.ENotificationImpl;
15
16 import org.eclipse.emf.ecore.util.EDataTypeEList;
17
18 import org.opendaylight.nemo.tool.eclipse.plugin.editor.EditorPackage;
19 import org.opendaylight.nemo.tool.eclipse.plugin.editor.Flow;
20 import org.opendaylight.nemo.tool.eclipse.plugin.editor.Node;
21 import org.opendaylight.nemo.tool.eclipse.plugin.editor.Operation;
22
23 /**
24  * <!-- begin-user-doc -->
25  * An implementation of the model object '<em><b>Operation</b></em>'.
26  * <!-- end-user-doc -->
27  * <p>
28  * The following features are implemented:
29  * </p>
30  * <ul>
31  *   <li>{@link org.opendaylight.nemo.tool.eclipse.plugin.editor.impl.OperationImpl#getName <em>Name</em>}</li>
32  *   <li>{@link org.opendaylight.nemo.tool.eclipse.plugin.editor.impl.OperationImpl#getValue <em>Value</em>}</li>
33  *   <li>{@link org.opendaylight.nemo.tool.eclipse.plugin.editor.impl.OperationImpl#getTargetId <em>Target Id</em>}</li>
34  *   <li>{@link org.opendaylight.nemo.tool.eclipse.plugin.editor.impl.OperationImpl#getTargetNode <em>Target Node</em>}</li>
35  * </ul>
36  *
37  * @generated
38  */
39 public class OperationImpl extends SentenceImpl implements Operation
40 {
41   /**
42    * The default value of the '{@link #getName() <em>Name</em>}' attribute.
43    * <!-- begin-user-doc -->
44    * <!-- end-user-doc -->
45    * @see #getName()
46    * @generated
47    * @ordered
48    */
49   protected static final String NAME_EDEFAULT = null;
50
51   /**
52    * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
53    * <!-- begin-user-doc -->
54    * <!-- end-user-doc -->
55    * @see #getName()
56    * @generated
57    * @ordered
58    */
59   protected String name = NAME_EDEFAULT;
60
61   /**
62    * The cached value of the '{@link #getValue() <em>Value</em>}' attribute list.
63    * <!-- begin-user-doc -->
64    * <!-- end-user-doc -->
65    * @see #getValue()
66    * @generated
67    * @ordered
68    */
69   protected EList<Integer> value;
70
71   /**
72    * The cached value of the '{@link #getTargetId() <em>Target Id</em>}' reference.
73    * <!-- begin-user-doc -->
74    * <!-- end-user-doc -->
75    * @see #getTargetId()
76    * @generated
77    * @ordered
78    */
79   protected Flow targetId;
80
81   /**
82    * The cached value of the '{@link #getTargetNode() <em>Target Node</em>}' reference.
83    * <!-- begin-user-doc -->
84    * <!-- end-user-doc -->
85    * @see #getTargetNode()
86    * @generated
87    * @ordered
88    */
89   protected Node targetNode;
90
91   /**
92    * <!-- begin-user-doc -->
93    * <!-- end-user-doc -->
94    * @generated
95    */
96   protected OperationImpl()
97   {
98     super();
99   }
100
101   /**
102    * <!-- begin-user-doc -->
103    * <!-- end-user-doc -->
104    * @generated
105    */
106   @Override
107   protected EClass eStaticClass()
108   {
109     return EditorPackage.Literals.OPERATION;
110   }
111
112   /**
113    * <!-- begin-user-doc -->
114    * <!-- end-user-doc -->
115    * @generated
116    */
117   public String getName()
118   {
119     return name;
120   }
121
122   /**
123    * <!-- begin-user-doc -->
124    * <!-- end-user-doc -->
125    * @generated
126    */
127   public void setName(String newName)
128   {
129     String oldName = name;
130     name = newName;
131     if (eNotificationRequired())
132       eNotify(new ENotificationImpl(this, Notification.SET, EditorPackage.OPERATION__NAME, oldName, name));
133   }
134
135   /**
136    * <!-- begin-user-doc -->
137    * <!-- end-user-doc -->
138    * @generated
139    */
140   public EList<Integer> getValue()
141   {
142     if (value == null)
143     {
144       value = new EDataTypeEList<Integer>(Integer.class, this, EditorPackage.OPERATION__VALUE);
145     }
146     return value;
147   }
148
149   /**
150    * <!-- begin-user-doc -->
151    * <!-- end-user-doc -->
152    * @generated
153    */
154   public Flow getTargetId()
155   {
156     if (targetId != null && targetId.eIsProxy())
157     {
158       InternalEObject oldTargetId = (InternalEObject)targetId;
159       targetId = (Flow)eResolveProxy(oldTargetId);
160       if (targetId != oldTargetId)
161       {
162         if (eNotificationRequired())
163           eNotify(new ENotificationImpl(this, Notification.RESOLVE, EditorPackage.OPERATION__TARGET_ID, oldTargetId, targetId));
164       }
165     }
166     return targetId;
167   }
168
169   /**
170    * <!-- begin-user-doc -->
171    * <!-- end-user-doc -->
172    * @generated
173    */
174   public Flow basicGetTargetId()
175   {
176     return targetId;
177   }
178
179   /**
180    * <!-- begin-user-doc -->
181    * <!-- end-user-doc -->
182    * @generated
183    */
184   public void setTargetId(Flow newTargetId)
185   {
186     Flow oldTargetId = targetId;
187     targetId = newTargetId;
188     if (eNotificationRequired())
189       eNotify(new ENotificationImpl(this, Notification.SET, EditorPackage.OPERATION__TARGET_ID, oldTargetId, targetId));
190   }
191
192   /**
193    * <!-- begin-user-doc -->
194    * <!-- end-user-doc -->
195    * @generated
196    */
197   public Node getTargetNode()
198   {
199     if (targetNode != null && targetNode.eIsProxy())
200     {
201       InternalEObject oldTargetNode = (InternalEObject)targetNode;
202       targetNode = (Node)eResolveProxy(oldTargetNode);
203       if (targetNode != oldTargetNode)
204       {
205         if (eNotificationRequired())
206           eNotify(new ENotificationImpl(this, Notification.RESOLVE, EditorPackage.OPERATION__TARGET_NODE, oldTargetNode, targetNode));
207       }
208     }
209     return targetNode;
210   }
211
212   /**
213    * <!-- begin-user-doc -->
214    * <!-- end-user-doc -->
215    * @generated
216    */
217   public Node basicGetTargetNode()
218   {
219     return targetNode;
220   }
221
222   /**
223    * <!-- begin-user-doc -->
224    * <!-- end-user-doc -->
225    * @generated
226    */
227   public void setTargetNode(Node newTargetNode)
228   {
229     Node oldTargetNode = targetNode;
230     targetNode = newTargetNode;
231     if (eNotificationRequired())
232       eNotify(new ENotificationImpl(this, Notification.SET, EditorPackage.OPERATION__TARGET_NODE, oldTargetNode, targetNode));
233   }
234
235   /**
236    * <!-- begin-user-doc -->
237    * <!-- end-user-doc -->
238    * @generated
239    */
240   @Override
241   public Object eGet(int featureID, boolean resolve, boolean coreType)
242   {
243     switch (featureID)
244     {
245       case EditorPackage.OPERATION__NAME:
246         return getName();
247       case EditorPackage.OPERATION__VALUE:
248         return getValue();
249       case EditorPackage.OPERATION__TARGET_ID:
250         if (resolve) return getTargetId();
251         return basicGetTargetId();
252       case EditorPackage.OPERATION__TARGET_NODE:
253         if (resolve) return getTargetNode();
254         return basicGetTargetNode();
255     }
256     return super.eGet(featureID, resolve, coreType);
257   }
258
259   /**
260    * <!-- begin-user-doc -->
261    * <!-- end-user-doc -->
262    * @generated
263    */
264   @SuppressWarnings("unchecked")
265   @Override
266   public void eSet(int featureID, Object newValue)
267   {
268     switch (featureID)
269     {
270       case EditorPackage.OPERATION__NAME:
271         setName((String)newValue);
272         return;
273       case EditorPackage.OPERATION__VALUE:
274         getValue().clear();
275         getValue().addAll((Collection<? extends Integer>)newValue);
276         return;
277       case EditorPackage.OPERATION__TARGET_ID:
278         setTargetId((Flow)newValue);
279         return;
280       case EditorPackage.OPERATION__TARGET_NODE:
281         setTargetNode((Node)newValue);
282         return;
283     }
284     super.eSet(featureID, newValue);
285   }
286
287   /**
288    * <!-- begin-user-doc -->
289    * <!-- end-user-doc -->
290    * @generated
291    */
292   @Override
293   public void eUnset(int featureID)
294   {
295     switch (featureID)
296     {
297       case EditorPackage.OPERATION__NAME:
298         setName(NAME_EDEFAULT);
299         return;
300       case EditorPackage.OPERATION__VALUE:
301         getValue().clear();
302         return;
303       case EditorPackage.OPERATION__TARGET_ID:
304         setTargetId((Flow)null);
305         return;
306       case EditorPackage.OPERATION__TARGET_NODE:
307         setTargetNode((Node)null);
308         return;
309     }
310     super.eUnset(featureID);
311   }
312
313   /**
314    * <!-- begin-user-doc -->
315    * <!-- end-user-doc -->
316    * @generated
317    */
318   @Override
319   public boolean eIsSet(int featureID)
320   {
321     switch (featureID)
322     {
323       case EditorPackage.OPERATION__NAME:
324         return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
325       case EditorPackage.OPERATION__VALUE:
326         return value != null && !value.isEmpty();
327       case EditorPackage.OPERATION__TARGET_ID:
328         return targetId != null;
329       case EditorPackage.OPERATION__TARGET_NODE:
330         return targetNode != null;
331     }
332     return super.eIsSet(featureID);
333   }
334
335   /**
336    * <!-- begin-user-doc -->
337    * <!-- end-user-doc -->
338    * @generated
339    */
340   @Override
341   public String toString()
342   {
343     if (eIsProxy()) return super.toString();
344
345     StringBuffer result = new StringBuffer(super.toString());
346     result.append(" (name: ");
347     result.append(name);
348     result.append(", value: ");
349     result.append(value);
350     result.append(')');
351     return result.toString();
352   }
353
354 } //OperationImpl