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%
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%
caseBot(Bot)
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%
caseHuman(Human)
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%
caseMember(Member)
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%
caseMemberGroup(MemberGroup)
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%
caseOrganization(Organization)
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%
casePrivilegedBot(PrivilegedBot)
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%
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: 234 C: 0
0%
M: 57 C: 0
0%
M: 34 C: 0
0%
M: 78 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.emf.ecp.view.table.ui.nebula.grid.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.emf.ecp.view.table.ui.nebula.grid.test.model.audit.AdminUser;
20: import org.eclipse.emf.ecp.view.table.ui.nebula.grid.test.model.audit.AuditPackage;
21: import org.eclipse.emf.ecp.view.table.ui.nebula.grid.test.model.audit.Bot;
22: import org.eclipse.emf.ecp.view.table.ui.nebula.grid.test.model.audit.GuestUser;
23: import org.eclipse.emf.ecp.view.table.ui.nebula.grid.test.model.audit.Human;
24: import org.eclipse.emf.ecp.view.table.ui.nebula.grid.test.model.audit.Member;
25: import org.eclipse.emf.ecp.view.table.ui.nebula.grid.test.model.audit.MemberGroup;
26: import org.eclipse.emf.ecp.view.table.ui.nebula.grid.test.model.audit.Organization;
27: import org.eclipse.emf.ecp.view.table.ui.nebula.grid.test.model.audit.PrivilegedBot;
28: import org.eclipse.emf.ecp.view.table.ui.nebula.grid.test.model.audit.PrivilegedUser;
29: import org.eclipse.emf.ecp.view.table.ui.nebula.grid.test.model.audit.RegisteredUser;
30:
31: /**
32: * <!-- begin-user-doc -->
33: * The <b>Switch</b> for the model's inheritance hierarchy.
34: * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
35: * to invoke the <code>caseXXX</code> method for each class of the model,
36: * starting with the actual class of the object
37: * and proceeding up the inheritance hierarchy
38: * until a non-null result is returned,
39: * which is the result of the switch.
40: * <!-- end-user-doc -->
41: *
42: * @see org.eclipse.emf.ecp.view.table.ui.nebula.grid.test.model.audit.AuditPackage
43: * @generated
44: */
45: public class AuditSwitch<T> extends Switch<T> {
46:         /**
47:          * The cached model package
48:          * <!-- begin-user-doc -->
49:          * <!-- end-user-doc -->
50:          *
51:          * @generated
52:          */
53:         protected static AuditPackage modelPackage;
54:
55:         /**
56:          * Creates an instance of the switch.
57:          * <!-- begin-user-doc -->
58:          * <!-- end-user-doc -->
59:          *
60:          * @generated
61:          */
62:         public AuditSwitch() {
63:•                if (modelPackage == null) {
64:                         modelPackage = AuditPackage.eINSTANCE;
65:                 }
66:         }
67:
68:         /**
69:          * Checks whether this is a switch for the given package.
70:          * <!-- begin-user-doc -->
71:          * <!-- end-user-doc -->
72:          *
73:          * @param ePackage the package in question.
74:          * @return whether this is a switch for the given package.
75:          * @generated
76:          */
77:         @Override
78:         protected boolean isSwitchFor(EPackage ePackage) {
79:•                return ePackage == modelPackage;
80:         }
81:
82:         /**
83:          * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that
84:          * result.
85:          * <!-- begin-user-doc -->
86:          * <!-- end-user-doc -->
87:          *
88:          * @return the first non-null result returned by a <code>caseXXX</code> call.
89:          * @generated
90:          */
91:         @Override
92:         protected T doSwitch(int classifierID, EObject theEObject) {
93:•                switch (classifierID) {
94:                 case AuditPackage.ORGANIZATION: {
95:                         final Organization organization = (Organization) theEObject;
96:                         T result = caseOrganization(organization);
97:•                        if (result == null) {
98:                                 result = defaultCase(theEObject);
99:                         }
100:                         return result;
101:                 }
102:                 case AuditPackage.MEMBER: {
103:                         final Member member = (Member) theEObject;
104:                         T result = caseMember(member);
105:•                        if (result == null) {
106:                                 result = defaultCase(theEObject);
107:                         }
108:                         return result;
109:                 }
110:                 case AuditPackage.BOT: {
111:                         final Bot bot = (Bot) theEObject;
112:                         T result = caseBot(bot);
113:•                        if (result == null) {
114:                                 result = caseMember(bot);
115:                         }
116:•                        if (result == null) {
117:                                 result = defaultCase(theEObject);
118:                         }
119:                         return result;
120:                 }
121:                 case AuditPackage.HUMAN: {
122:                         final Human human = (Human) theEObject;
123:                         T result = caseHuman(human);
124:•                        if (result == null) {
125:                                 result = caseMember(human);
126:                         }
127:•                        if (result == null) {
128:                                 result = defaultCase(theEObject);
129:                         }
130:                         return result;
131:                 }
132:                 case AuditPackage.GUEST_USER: {
133:                         final GuestUser guestUser = (GuestUser) theEObject;
134:                         T result = caseGuestUser(guestUser);
135:•                        if (result == null) {
136:                                 result = caseHuman(guestUser);
137:                         }
138:•                        if (result == null) {
139:                                 result = caseMember(guestUser);
140:                         }
141:•                        if (result == null) {
142:                                 result = defaultCase(theEObject);
143:                         }
144:                         return result;
145:                 }
146:                 case AuditPackage.REGISTERED_USER: {
147:                         final RegisteredUser registeredUser = (RegisteredUser) theEObject;
148:                         T result = caseRegisteredUser(registeredUser);
149:•                        if (result == null) {
150:                                 result = caseHuman(registeredUser);
151:                         }
152:•                        if (result == null) {
153:                                 result = caseMember(registeredUser);
154:                         }
155:•                        if (result == null) {
156:                                 result = defaultCase(theEObject);
157:                         }
158:                         return result;
159:                 }
160:                 case AuditPackage.PRIVILEGED_USER: {
161:                         final PrivilegedUser privilegedUser = (PrivilegedUser) theEObject;
162:                         T result = casePrivilegedUser(privilegedUser);
163:•                        if (result == null) {
164:                                 result = defaultCase(theEObject);
165:                         }
166:                         return result;
167:                 }
168:                 case AuditPackage.ADMIN_USER: {
169:                         final AdminUser adminUser = (AdminUser) theEObject;
170:                         T result = caseAdminUser(adminUser);
171:•                        if (result == null) {
172:                                 result = caseRegisteredUser(adminUser);
173:                         }
174:•                        if (result == null) {
175:                                 result = casePrivilegedUser(adminUser);
176:                         }
177:•                        if (result == null) {
178:                                 result = caseHuman(adminUser);
179:                         }
180:•                        if (result == null) {
181:                                 result = caseMember(adminUser);
182:                         }
183:•                        if (result == null) {
184:                                 result = defaultCase(theEObject);
185:                         }
186:                         return result;
187:                 }
188:                 case AuditPackage.PRIVILEGED_BOT: {
189:                         final PrivilegedBot privilegedBot = (PrivilegedBot) theEObject;
190:                         T result = casePrivilegedBot(privilegedBot);
191:•                        if (result == null) {
192:                                 result = caseBot(privilegedBot);
193:                         }
194:•                        if (result == null) {
195:                                 result = casePrivilegedUser(privilegedBot);
196:                         }
197:•                        if (result == null) {
198:                                 result = caseMember(privilegedBot);
199:                         }
200:•                        if (result == null) {
201:                                 result = defaultCase(theEObject);
202:                         }
203:                         return result;
204:                 }
205:                 case AuditPackage.MEMBER_GROUP: {
206:                         final MemberGroup memberGroup = (MemberGroup) theEObject;
207:                         T result = caseMemberGroup(memberGroup);
208:•                        if (result == null) {
209:                                 result = defaultCase(theEObject);
210:                         }
211:                         return result;
212:                 }
213:                 default:
214:                         return defaultCase(theEObject);
215:                 }
216:         }
217:
218:         /**
219:          * Returns the result of interpreting the object as an instance of '<em>Organization</em>'.
220:          * <!-- begin-user-doc -->
221:          * This implementation returns null;
222:          * returning a non-null result will terminate the switch.
223:          * <!-- end-user-doc -->
224:          *
225:          * @param object the target of the switch.
226:          * @return the result of interpreting the object as an instance of '<em>Organization</em>'.
227:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
228:          * @generated
229:          */
230:         public T caseOrganization(Organization object) {
231:                 return null;
232:         }
233:
234:         /**
235:          * Returns the result of interpreting the object as an instance of '<em>Member</em>'.
236:          * <!-- begin-user-doc -->
237:          * This implementation returns null;
238:          * returning a non-null result will terminate the switch.
239:          * <!-- end-user-doc -->
240:          *
241:          * @param object the target of the switch.
242:          * @return the result of interpreting the object as an instance of '<em>Member</em>'.
243:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
244:          * @generated
245:          */
246:         public T caseMember(Member object) {
247:                 return null;
248:         }
249:
250:         /**
251:          * Returns the result of interpreting the object as an instance of '<em>Bot</em>'.
252:          * <!-- begin-user-doc -->
253:          * This implementation returns null;
254:          * returning a non-null result will terminate the switch.
255:          * <!-- end-user-doc -->
256:          *
257:          * @param object the target of the switch.
258:          * @return the result of interpreting the object as an instance of '<em>Bot</em>'.
259:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
260:          * @generated
261:          */
262:         public T caseBot(Bot object) {
263:                 return null;
264:         }
265:
266:         /**
267:          * Returns the result of interpreting the object as an instance of '<em>Human</em>'.
268:          * <!-- begin-user-doc -->
269:          * This implementation returns null;
270:          * returning a non-null result will terminate the switch.
271:          * <!-- end-user-doc -->
272:          *
273:          * @param object the target of the switch.
274:          * @return the result of interpreting the object as an instance of '<em>Human</em>'.
275:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
276:          * @generated
277:          */
278:         public T caseHuman(Human object) {
279:                 return null;
280:         }
281:
282:         /**
283:          * Returns the result of interpreting the object as an instance of '<em>Guest User</em>'.
284:          * <!-- begin-user-doc -->
285:          * This implementation returns null;
286:          * returning a non-null result will terminate the switch.
287:          * <!-- end-user-doc -->
288:          *
289:          * @param object the target of the switch.
290:          * @return the result of interpreting the object as an instance of '<em>Guest User</em>'.
291:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
292:          * @generated
293:          */
294:         public T caseGuestUser(GuestUser object) {
295:                 return null;
296:         }
297:
298:         /**
299:          * Returns the result of interpreting the object as an instance of '<em>Registered User</em>'.
300:          * <!-- begin-user-doc -->
301:          * This implementation returns null;
302:          * returning a non-null result will terminate the switch.
303:          * <!-- end-user-doc -->
304:          *
305:          * @param object the target of the switch.
306:          * @return the result of interpreting the object as an instance of '<em>Registered User</em>'.
307:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
308:          * @generated
309:          */
310:         public T caseRegisteredUser(RegisteredUser object) {
311:                 return null;
312:         }
313:
314:         /**
315:          * Returns the result of interpreting the object as an instance of '<em>Privileged User</em>'.
316:          * <!-- begin-user-doc -->
317:          * This implementation returns null;
318:          * returning a non-null result will terminate the switch.
319:          * <!-- end-user-doc -->
320:          *
321:          * @param object the target of the switch.
322:          * @return the result of interpreting the object as an instance of '<em>Privileged User</em>'.
323:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
324:          * @generated
325:          */
326:         public T casePrivilegedUser(PrivilegedUser object) {
327:                 return null;
328:         }
329:
330:         /**
331:          * Returns the result of interpreting the object as an instance of '<em>Admin User</em>'.
332:          * <!-- begin-user-doc -->
333:          * This implementation returns null;
334:          * returning a non-null result will terminate the switch.
335:          * <!-- end-user-doc -->
336:          *
337:          * @param object the target of the switch.
338:          * @return the result of interpreting the object as an instance of '<em>Admin User</em>'.
339:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
340:          * @generated
341:          */
342:         public T caseAdminUser(AdminUser object) {
343:                 return null;
344:         }
345:
346:         /**
347:          * Returns the result of interpreting the object as an instance of '<em>Privileged Bot</em>'.
348:          * <!-- begin-user-doc -->
349:          * This implementation returns null;
350:          * returning a non-null result will terminate the switch.
351:          * <!-- end-user-doc -->
352:          *
353:          * @param object the target of the switch.
354:          * @return the result of interpreting the object as an instance of '<em>Privileged Bot</em>'.
355:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
356:          * @generated
357:          */
358:         public T casePrivilegedBot(PrivilegedBot object) {
359:                 return null;
360:         }
361:
362:         /**
363:          * Returns the result of interpreting the object as an instance of '<em>Member Group</em>'.
364:          * <!-- begin-user-doc -->
365:          * This implementation returns null;
366:          * returning a non-null result will terminate the switch.
367:          * <!-- end-user-doc -->
368:          *
369:          * @param object the target of the switch.
370:          * @return the result of interpreting the object as an instance of '<em>Member Group</em>'.
371:          * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
372:          * @generated
373:          */
374:         public T caseMemberGroup(MemberGroup object) {
375:                 return null;
376:         }
377:
378:         /**
379:          * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
380:          * <!-- begin-user-doc -->
381:          * This implementation returns null;
382:          * returning a non-null result will terminate the switch, but this is the last case anyway.
383:          * <!-- end-user-doc -->
384:          *
385:          * @param object the target of the switch.
386:          * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
387:          * @see #doSwitch(org.eclipse.emf.ecore.EObject)
388:          * @generated
389:          */
390:         @Override
391:         public T defaultCase(EObject object) {
392:                 return null;
393:         }
394:
395: } // AuditSwitch