Skip to content

Package: AuditSwitch

AuditSwitch

nameinstructionbranchcomplexitylinemethod
AuditSwitch()
M: 7 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
caseAbstractSubUser(AbstractSubUser)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseAdminUser(AdminUser)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseGuestUser(GuestUser)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
casePrivilegedUser(PrivilegedUser)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseRegisteredUser(RegisteredUser)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseUser(User)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
caseUserGroup(UserGroup)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
defaultCase(EObject)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
doSwitch(int, EObject)
M: 153 C: 0
0%
M: 36 C: 0
0%
M: 22 C: 0
0%
M: 51 C: 0
0%
M: 1 C: 0
0%
isSwitchFor(EPackage)
M: 7 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (c) 2011-2018 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * EclipseSource Munich - initial API and implementation
13: */
14: package org.eclipse.emfforms.core.services.datatemplate.test.model.audit.util;
15:
16: import org.eclipse.emf.ecore.EObject;
17: import org.eclipse.emf.ecore.EPackage;
18: import org.eclipse.emf.ecore.util.Switch;
19: import org.eclipse.emfforms.core.services.datatemplate.test.model.audit.AbstractSubUser;
20: import org.eclipse.emfforms.core.services.datatemplate.test.model.audit.AdminUser;
21: import org.eclipse.emfforms.core.services.datatemplate.test.model.audit.AuditPackage;
22: import org.eclipse.emfforms.core.services.datatemplate.test.model.audit.GuestUser;
23: import org.eclipse.emfforms.core.services.datatemplate.test.model.audit.PrivilegedUser;
24: import org.eclipse.emfforms.core.services.datatemplate.test.model.audit.RegisteredUser;
25: import org.eclipse.emfforms.core.services.datatemplate.test.model.audit.User;
26: import org.eclipse.emfforms.core.services.datatemplate.test.model.audit.UserGroup;
27:
28: /**
29: * <!-- begin-user-doc -->
30: * The <b>Switch</b> for the model's inheritance hierarchy.
31: * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
32: * to invoke the <code>caseXXX</code> method for each class of the model,
33: * starting with the actual class of the object
34: * and proceeding up the inheritance hierarchy
35: * until a non-null result is returned,
36: * which is the result of the switch.
37: * <!-- end-user-doc -->
38: *
39: * @see org.eclipse.emfforms.core.services.datatemplate.test.model.audit.AuditPackage
40: * @generated
41: */
42: public class AuditSwitch<T> extends Switch<T> {
43:         /**
44:          * The cached model package
45:          * <!-- begin-user-doc -->
46:          * <!-- end-user-doc -->
47:          *
48:          * @generated
49:          */
50:         protected static AuditPackage modelPackage;
51:
52:         /**
53:          * Creates an instance of the switch.
54:          * <!-- begin-user-doc -->
55:          * <!-- end-user-doc -->
56:          *
57:          * @generated
58:          */
59:         public AuditSwitch() {
60:•                if (modelPackage == null) {
61:                         modelPackage = AuditPackage.eINSTANCE;
62:                 }
63:         }
64:
65:         /**
66:          * Checks whether this is a switch for the given package.
67:          * <!-- begin-user-doc -->
68:          * <!-- end-user-doc -->
69:          *
70:          * @param ePackage the package in question.
71:          * @return whether this is a switch for the given package.
72:          * @generated
73:          */
74:         @Override
75:         protected boolean isSwitchFor(EPackage ePackage) {
76:•                return ePackage == modelPackage;
77:         }
78:
79:         /**
80:          * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
81:          * result.
82:          * <!-- begin-user-doc -->
83:          * <!-- end-user-doc -->
84:          *
85:          * @return the first non-null result returned by a <code>caseXXX</code> call.
86:          * @generated
87:          */
88:         @Override
89:         protected T doSwitch(int classifierID, EObject theEObject) {
90:•                switch (classifierID) {
91:                 case AuditPackage.USER: {
92:                         User user = (User) theEObject;
93:                         T result = caseUser(user);
94:•                        if (result == null)
95:                                 result = defaultCase(theEObject);
96:                         return result;
97:                 }
98:                 case AuditPackage.PRIVILEGED_USER: {
99:                         PrivilegedUser privilegedUser = (PrivilegedUser) theEObject;
100:                         T result = casePrivilegedUser(privilegedUser);
101:•                        if (result == null)
102:                                 result = caseUser(privilegedUser);
103:•                        if (result == null)
104:                                 result = defaultCase(theEObject);
105:                         return result;
106:                 }
107:                 case AuditPackage.GUEST_USER: {
108:                         GuestUser guestUser = (GuestUser) theEObject;
109:                         T result = caseGuestUser(guestUser);
110:•                        if (result == null)
111:                                 result = caseUser(guestUser);
112:•                        if (result == null)
113:                                 result = defaultCase(theEObject);
114:                         return result;
115:                 }
116:                 case AuditPackage.REGISTERED_USER: {
117:                         RegisteredUser registeredUser = (RegisteredUser) theEObject;
118:                         T result = caseRegisteredUser(registeredUser);
119:•                        if (result == null)
120:                                 result = caseUser(registeredUser);
121:•                        if (result == null)
122:                                 result = defaultCase(theEObject);
123:                         return result;
124:                 }
125:                 case AuditPackage.ADMIN_USER: {
126:                         AdminUser adminUser = (AdminUser) theEObject;
127:                         T result = caseAdminUser(adminUser);
128:•                        if (result == null)
129:                                 result = caseRegisteredUser(adminUser);
130:•                        if (result == null)
131:                                 result = casePrivilegedUser(adminUser);
132:•                        if (result == null)
133:                                 result = caseUser(adminUser);
134:•                        if (result == null)
135:                                 result = defaultCase(theEObject);
136:                         return result;
137:                 }
138:                 case AuditPackage.USER_GROUP: {
139:                         UserGroup userGroup = (UserGroup) theEObject;
140:                         T result = caseUserGroup(userGroup);
141:•                        if (result == null)
142:                                 result = defaultCase(theEObject);
143:                         return result;
144:                 }
145:                 case AuditPackage.ABSTRACT_SUB_USER: {
146:                         AbstractSubUser abstractSubUser = (AbstractSubUser) theEObject;
147:                         T result = caseAbstractSubUser(abstractSubUser);
148:•                        if (result == null)
149:                                 result = caseUser(abstractSubUser);
150:•                        if (result == null)
151:                                 result = defaultCase(theEObject);
152:                         return result;
153:                 }
154:                 default:
155:                         return defaultCase(theEObject);
156:                 }
157:         }
158:
159:         /**
160:          * Returns the result of interpreting the object as an instance of '<em>User</em>'.
161:          * <!-- begin-user-doc -->
162:          * This implementation returns null;
163:          * returning a non-null result will terminate the switch.
164:          * <!-- end-user-doc -->
165:          *
166:          * @param object the target of the switch.
167:          * @return the result of interpreting the object as an instance of '<em>User</em>'.
168:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
169:          * @generated
170:          */
171:         public T caseUser(User object) {
172:                 return null;
173:         }
174:
175:         /**
176:          * Returns the result of interpreting the object as an instance of '<em>Privileged User</em>'.
177:          * <!-- begin-user-doc -->
178:          * This implementation returns null;
179:          * returning a non-null result will terminate the switch.
180:          * <!-- end-user-doc -->
181:          *
182:          * @param object the target of the switch.
183:          * @return the result of interpreting the object as an instance of '<em>Privileged User</em>'.
184:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
185:          * @generated
186:          */
187:         public T casePrivilegedUser(PrivilegedUser object) {
188:                 return null;
189:         }
190:
191:         /**
192:          * Returns the result of interpreting the object as an instance of '<em>Guest User</em>'.
193:          * <!-- begin-user-doc -->
194:          * This implementation returns null;
195:          * returning a non-null result will terminate the switch.
196:          * <!-- end-user-doc -->
197:          *
198:          * @param object the target of the switch.
199:          * @return the result of interpreting the object as an instance of '<em>Guest User</em>'.
200:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
201:          * @generated
202:          */
203:         public T caseGuestUser(GuestUser object) {
204:                 return null;
205:         }
206:
207:         /**
208:          * Returns the result of interpreting the object as an instance of '<em>Registered User</em>'.
209:          * <!-- begin-user-doc -->
210:          * This implementation returns null;
211:          * returning a non-null result will terminate the switch.
212:          * <!-- end-user-doc -->
213:          *
214:          * @param object the target of the switch.
215:          * @return the result of interpreting the object as an instance of '<em>Registered User</em>'.
216:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
217:          * @generated
218:          */
219:         public T caseRegisteredUser(RegisteredUser object) {
220:                 return null;
221:         }
222:
223:         /**
224:          * Returns the result of interpreting the object as an instance of '<em>Admin User</em>'.
225:          * <!-- begin-user-doc -->
226:          * This implementation returns null;
227:          * returning a non-null result will terminate the switch.
228:          * <!-- end-user-doc -->
229:          *
230:          * @param object the target of the switch.
231:          * @return the result of interpreting the object as an instance of '<em>Admin User</em>'.
232:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
233:          * @generated
234:          */
235:         public T caseAdminUser(AdminUser object) {
236:                 return null;
237:         }
238:
239:         /**
240:          * Returns the result of interpreting the object as an instance of '<em>User Group</em>'.
241:          * <!-- begin-user-doc -->
242:          * This implementation returns null;
243:          * returning a non-null result will terminate the switch.
244:          * <!-- end-user-doc -->
245:          *
246:          * @param object the target of the switch.
247:          * @return the result of interpreting the object as an instance of '<em>User Group</em>'.
248:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
249:          * @generated
250:          */
251:         public T caseUserGroup(UserGroup object) {
252:                 return null;
253:         }
254:
255:         /**
256:          * Returns the result of interpreting the object as an instance of '<em>Abstract Sub User</em>'.
257:          * <!-- begin-user-doc -->
258:          * This implementation returns null;
259:          * returning a non-null result will terminate the switch.
260:          * <!-- end-user-doc -->
261:          *
262:          * @param object the target of the switch.
263:          * @return the result of interpreting the object as an instance of '<em>Abstract Sub User</em>'.
264:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
265:          * @generated
266:          */
267:         public T caseAbstractSubUser(AbstractSubUser object) {
268:                 return null;
269:         }
270:
271:         /**
272:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
273:          * <!-- begin-user-doc -->
274:          * This implementation returns null;
275:          * returning a non-null result will terminate the switch, but this is the last case anyway.
276:          * <!-- end-user-doc -->
277:          *
278:          * @param object the target of the switch.
279:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
280:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
281:          * @generated
282:          */
283:         @Override
284:         public T defaultCase(EObject object) {
285:                 return null;
286:         }
287:
288: } // AuditSwitch