3 package org.simantics.aeri.redmine.core.settings.util;
5 import org.eclipse.emf.ecore.EObject;
6 import org.eclipse.emf.ecore.EPackage;
8 import org.eclipse.emf.ecore.util.Switch;
10 import org.simantics.aeri.redmine.core.settings.*;
13 * <!-- begin-user-doc -->
14 * The <b>Switch</b> for the model's inheritance hierarchy.
15 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
16 * to invoke the <code>caseXXX</code> method for each class of the model,
17 * starting with the actual class of the object
18 * and proceeding up the inheritance hierarchy
19 * until a non-null result is returned,
20 * which is the result of the switch.
21 * <!-- end-user-doc -->
22 * @see org.simantics.aeri.redmine.core.settings.RedmineAERISettingsPackage
25 public class RedmineAERISettingsSwitch<T> extends Switch<T> {
27 * The cached model package
28 * <!-- begin-user-doc -->
29 * <!-- end-user-doc -->
32 protected static RedmineAERISettingsPackage modelPackage;
35 * Creates an instance of the switch.
36 * <!-- begin-user-doc -->
37 * <!-- end-user-doc -->
40 public RedmineAERISettingsSwitch() {
41 if (modelPackage == null) {
42 modelPackage = RedmineAERISettingsPackage.eINSTANCE;
47 * Checks whether this is a switch for the given package.
48 * <!-- begin-user-doc -->
49 * <!-- end-user-doc -->
50 * @param ePackage the package in question.
51 * @return whether this is a switch for the given package.
55 protected boolean isSwitchFor(EPackage ePackage) {
56 return ePackage == modelPackage;
60 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
61 * <!-- begin-user-doc -->
62 * <!-- end-user-doc -->
63 * @return the first non-null result returned by a <code>caseXXX</code> call.
67 protected T doSwitch(int classifierID, EObject theEObject) {
68 switch (classifierID) {
69 case RedmineAERISettingsPackage.REDMINE_AERI_SETTINGS: {
70 RedmineAERISettings redmineAERISettings = (RedmineAERISettings)theEObject;
71 T result = caseRedmineAERISettings(redmineAERISettings);
72 if (result == null) result = defaultCase(theEObject);
75 default: return defaultCase(theEObject);
80 * Returns the result of interpreting the object as an instance of '<em>Redmine AERI Settings</em>'.
81 * <!-- begin-user-doc -->
82 * This implementation returns null;
83 * returning a non-null result will terminate the switch.
84 * <!-- end-user-doc -->
85 * @param object the target of the switch.
86 * @return the result of interpreting the object as an instance of '<em>Redmine AERI Settings</em>'.
87 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
90 public T caseRedmineAERISettings(RedmineAERISettings object) {
95 * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
96 * <!-- begin-user-doc -->
97 * This implementation returns null;
98 * returning a non-null result will terminate the switch, but this is the last case anyway.
99 * <!-- end-user-doc -->
100 * @param object the target of the switch.
101 * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
102 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
106 public T defaultCase(EObject object) {
110 } //RedmineAERISettingsSwitch