Skip to content

Package: CoffeeFactoryImpl

CoffeeFactoryImpl

nameinstructionbranchcomplexitylinemethod
CoffeeFactoryImpl()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
convertManufactoringProcessToString(EDataType, Object)
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%
convertRamTypeToString(EDataType, Object)
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%
convertSocketConnectorTypeToString(EDataType, Object)
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%
convertToString(EDataType, Object)
M: 32 C: 0
0%
M: 4 C: 0
0%
M: 4 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
create(EClass)
M: 47 C: 0
0%
M: 11 C: 0
0%
M: 11 C: 0
0%
M: 12 C: 0
0%
M: 1 C: 0
0%
createActivity()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createBrewingUnit()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createControlUnit()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createDimension()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createDipTray()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createDisplay()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createFromString(EDataType, String)
M: 32 C: 0
0%
M: 4 C: 0
0%
M: 4 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
createMachine()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createManufactoringProcessFromString(EDataType, String)
M: 25 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
createProcessor()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createRAM()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
createRamTypeFromString(EDataType, String)
M: 25 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
createSocketConnectorTypeFromString(EDataType, String)
M: 25 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
createWaterTank()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getCoffeePackage()
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getPackage()
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%
init()
M: 17 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 7 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.coffee.model.coffee.impl;
15:
16: import org.eclipse.emf.ecore.EClass;
17: import org.eclipse.emf.ecore.EDataType;
18: import org.eclipse.emf.ecore.EObject;
19: import org.eclipse.emf.ecore.EPackage;
20: import org.eclipse.emf.ecore.impl.EFactoryImpl;
21: import org.eclipse.emf.ecore.plugin.EcorePlugin;
22: import org.eclipse.emfforms.coffee.model.coffee.Activity;
23: import org.eclipse.emfforms.coffee.model.coffee.BrewingUnit;
24: import org.eclipse.emfforms.coffee.model.coffee.CoffeeFactory;
25: import org.eclipse.emfforms.coffee.model.coffee.CoffeePackage;
26: import org.eclipse.emfforms.coffee.model.coffee.ControlUnit;
27: import org.eclipse.emfforms.coffee.model.coffee.Dimension;
28: import org.eclipse.emfforms.coffee.model.coffee.DipTray;
29: import org.eclipse.emfforms.coffee.model.coffee.Display;
30: import org.eclipse.emfforms.coffee.model.coffee.Machine;
31: import org.eclipse.emfforms.coffee.model.coffee.ManufactoringProcess;
32: import org.eclipse.emfforms.coffee.model.coffee.Processor;
33: import org.eclipse.emfforms.coffee.model.coffee.RAM;
34: import org.eclipse.emfforms.coffee.model.coffee.RamType;
35: import org.eclipse.emfforms.coffee.model.coffee.SocketConnectorType;
36: import org.eclipse.emfforms.coffee.model.coffee.WaterTank;
37:
38: /**
39: * <!-- begin-user-doc -->
40: * An implementation of the model <b>Factory</b>.
41: * <!-- end-user-doc -->
42: *
43: * @generated
44: */
45: public class CoffeeFactoryImpl extends EFactoryImpl implements CoffeeFactory {
46:         /**
47:          * Creates the default factory implementation.
48:          * <!-- begin-user-doc -->
49:          * <!-- end-user-doc -->
50:          *
51:          * @generated
52:          */
53:         public static CoffeeFactory init() {
54:                 try {
55:                         final CoffeeFactory theCoffeeFactory = (CoffeeFactory) EPackage.Registry.INSTANCE
56:                                 .getEFactory(CoffeePackage.eNS_URI);
57:•                        if (theCoffeeFactory != null) {
58:                                 return theCoffeeFactory;
59:                         }
60:                 } catch (final Exception exception) {
61:                         EcorePlugin.INSTANCE.log(exception);
62:                 }
63:                 return new CoffeeFactoryImpl();
64:         }
65:
66:         /**
67:          * Creates an instance of the factory.
68:          * <!-- begin-user-doc -->
69:          * <!-- end-user-doc -->
70:          *
71:          * @generated
72:          */
73:         public CoffeeFactoryImpl() {
74:                 super();
75:         }
76:
77:         /**
78:          * <!-- begin-user-doc -->
79:          * <!-- end-user-doc -->
80:          *
81:          * @generated
82:          */
83:         @Override
84:         public EObject create(EClass eClass) {
85:•                switch (eClass.getClassifierID()) {
86:                 case CoffeePackage.MACHINE:
87:                         return createMachine();
88:                 case CoffeePackage.CONTROL_UNIT:
89:                         return createControlUnit();
90:                 case CoffeePackage.BREWING_UNIT:
91:                         return createBrewingUnit();
92:                 case CoffeePackage.DIP_TRAY:
93:                         return createDipTray();
94:                 case CoffeePackage.WATER_TANK:
95:                         return createWaterTank();
96:                 case CoffeePackage.PROCESSOR:
97:                         return createProcessor();
98:                 case CoffeePackage.RAM:
99:                         return createRAM();
100:                 case CoffeePackage.ACTIVITY:
101:                         return createActivity();
102:                 case CoffeePackage.DIMENSION:
103:                         return createDimension();
104:                 case CoffeePackage.DISPLAY:
105:                         return createDisplay();
106:                 default:
107:                         throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
108:                 }
109:         }
110:
111:         /**
112:          * <!-- begin-user-doc -->
113:          * <!-- end-user-doc -->
114:          *
115:          * @generated
116:          */
117:         @Override
118:         public Object createFromString(EDataType eDataType, String initialValue) {
119:•                switch (eDataType.getClassifierID()) {
120:                 case CoffeePackage.SOCKET_CONNECTOR_TYPE:
121:                         return createSocketConnectorTypeFromString(eDataType, initialValue);
122:                 case CoffeePackage.MANUFACTORING_PROCESS:
123:                         return createManufactoringProcessFromString(eDataType, initialValue);
124:                 case CoffeePackage.RAM_TYPE:
125:                         return createRamTypeFromString(eDataType, initialValue);
126:                 default:
127:                         throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
128:                 }
129:         }
130:
131:         /**
132:          * <!-- begin-user-doc -->
133:          * <!-- end-user-doc -->
134:          *
135:          * @generated
136:          */
137:         @Override
138:         public String convertToString(EDataType eDataType, Object instanceValue) {
139:•                switch (eDataType.getClassifierID()) {
140:                 case CoffeePackage.SOCKET_CONNECTOR_TYPE:
141:                         return convertSocketConnectorTypeToString(eDataType, instanceValue);
142:                 case CoffeePackage.MANUFACTORING_PROCESS:
143:                         return convertManufactoringProcessToString(eDataType, instanceValue);
144:                 case CoffeePackage.RAM_TYPE:
145:                         return convertRamTypeToString(eDataType, instanceValue);
146:                 default:
147:                         throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$
148:                 }
149:         }
150:
151:         /**
152:          * <!-- begin-user-doc -->
153:          * <!-- end-user-doc -->
154:          *
155:          * @generated
156:          */
157:         @Override
158:         public Machine createMachine() {
159:                 final MachineImpl machine = new MachineImpl();
160:                 return machine;
161:         }
162:
163:         /**
164:          * <!-- begin-user-doc -->
165:          * <!-- end-user-doc -->
166:          *
167:          * @generated
168:          */
169:         @Override
170:         public ControlUnit createControlUnit() {
171:                 final ControlUnitImpl controlUnit = new ControlUnitImpl();
172:                 return controlUnit;
173:         }
174:
175:         /**
176:          * <!-- begin-user-doc -->
177:          * <!-- end-user-doc -->
178:          *
179:          * @generated
180:          */
181:         @Override
182:         public BrewingUnit createBrewingUnit() {
183:                 final BrewingUnitImpl brewingUnit = new BrewingUnitImpl();
184:                 return brewingUnit;
185:         }
186:
187:         /**
188:          * <!-- begin-user-doc -->
189:          * <!-- end-user-doc -->
190:          *
191:          * @generated
192:          */
193:         @Override
194:         public DipTray createDipTray() {
195:                 final DipTrayImpl dipTray = new DipTrayImpl();
196:                 return dipTray;
197:         }
198:
199:         /**
200:          * <!-- begin-user-doc -->
201:          * <!-- end-user-doc -->
202:          *
203:          * @generated
204:          */
205:         @Override
206:         public WaterTank createWaterTank() {
207:                 final WaterTankImpl waterTank = new WaterTankImpl();
208:                 return waterTank;
209:         }
210:
211:         /**
212:          * <!-- begin-user-doc -->
213:          * <!-- end-user-doc -->
214:          *
215:          * @generated
216:          */
217:         @Override
218:         public Processor createProcessor() {
219:                 final ProcessorImpl processor = new ProcessorImpl();
220:                 return processor;
221:         }
222:
223:         /**
224:          * <!-- begin-user-doc -->
225:          * <!-- end-user-doc -->
226:          *
227:          * @generated
228:          */
229:         @Override
230:         public RAM createRAM() {
231:                 final RAMImpl ram = new RAMImpl();
232:                 return ram;
233:         }
234:
235:         /**
236:          * <!-- begin-user-doc -->
237:          * <!-- end-user-doc -->
238:          *
239:          * @generated
240:          */
241:         @Override
242:         public Activity createActivity() {
243:                 final ActivityImpl activity = new ActivityImpl();
244:                 return activity;
245:         }
246:
247:         /**
248:          * <!-- begin-user-doc -->
249:          * <!-- end-user-doc -->
250:          *
251:          * @generated
252:          */
253:         @Override
254:         public Dimension createDimension() {
255:                 final DimensionImpl dimension = new DimensionImpl();
256:                 return dimension;
257:         }
258:
259:         /**
260:          * <!-- begin-user-doc -->
261:          * <!-- end-user-doc -->
262:          *
263:          * @generated
264:          */
265:         @Override
266:         public Display createDisplay() {
267:                 final DisplayImpl display = new DisplayImpl();
268:                 return display;
269:         }
270:
271:         /**
272:          * <!-- begin-user-doc -->
273:          * <!-- end-user-doc -->
274:          *
275:          * @generated
276:          */
277:         public SocketConnectorType createSocketConnectorTypeFromString(EDataType eDataType, String initialValue) {
278:                 final SocketConnectorType result = SocketConnectorType.get(initialValue);
279:•                if (result == null) {
280:                         throw new IllegalArgumentException(
281:                                 "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
282:                 }
283:                 return result;
284:         }
285:
286:         /**
287:          * <!-- begin-user-doc -->
288:          * <!-- end-user-doc -->
289:          *
290:          * @generated
291:          */
292:         public String convertSocketConnectorTypeToString(EDataType eDataType, Object instanceValue) {
293:•                return instanceValue == null ? null : instanceValue.toString();
294:         }
295:
296:         /**
297:          * <!-- begin-user-doc -->
298:          * <!-- end-user-doc -->
299:          *
300:          * @generated
301:          */
302:         public ManufactoringProcess createManufactoringProcessFromString(EDataType eDataType, String initialValue) {
303:                 final ManufactoringProcess result = ManufactoringProcess.get(initialValue);
304:•                if (result == null) {
305:                         throw new IllegalArgumentException(
306:                                 "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
307:                 }
308:                 return result;
309:         }
310:
311:         /**
312:          * <!-- begin-user-doc -->
313:          * <!-- end-user-doc -->
314:          *
315:          * @generated
316:          */
317:         public String convertManufactoringProcessToString(EDataType eDataType, Object instanceValue) {
318:•                return instanceValue == null ? null : instanceValue.toString();
319:         }
320:
321:         /**
322:          * <!-- begin-user-doc -->
323:          * <!-- end-user-doc -->
324:          *
325:          * @generated
326:          */
327:         public RamType createRamTypeFromString(EDataType eDataType, String initialValue) {
328:                 final RamType result = RamType.get(initialValue);
329:•                if (result == null) {
330:                         throw new IllegalArgumentException(
331:                                 "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
332:                 }
333:                 return result;
334:         }
335:
336:         /**
337:          * <!-- begin-user-doc -->
338:          * <!-- end-user-doc -->
339:          *
340:          * @generated
341:          */
342:         public String convertRamTypeToString(EDataType eDataType, Object instanceValue) {
343:•                return instanceValue == null ? null : instanceValue.toString();
344:         }
345:
346:         /**
347:          * <!-- begin-user-doc -->
348:          * <!-- end-user-doc -->
349:          *
350:          * @generated
351:          */
352:         @Override
353:         public CoffeePackage getCoffeePackage() {
354:                 return (CoffeePackage) getEPackage();
355:         }
356:
357:         /**
358:          * <!-- begin-user-doc -->
359:          * <!-- end-user-doc -->
360:          *
361:          * @deprecated
362:          * @generated
363:          */
364:         @Deprecated
365:         public static CoffeePackage getPackage() {
366:                 return CoffeePackage.eINSTANCE;
367:         }
368:
369: } // CoffeeFactoryImpl