Skip to content

Package: PersonImpl

PersonImpl

nameinstructionbranchcomplexitylinemethod
PersonImpl()
M: 18 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
eGet(int, boolean, boolean)
M: 23 C: 0
0%
M: 6 C: 0
0%
M: 6 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 86 C: 0
0%
M: 32 C: 0
0%
M: 19 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
eSet(int, Object)
M: 32 C: 0
0%
M: 6 C: 0
0%
M: 6 C: 0
0%
M: 13 C: 0
0%
M: 1 C: 0
0%
eStaticClass()
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%
eUnset(int)
M: 26 C: 0
0%
M: 6 C: 0
0%
M: 6 C: 0
0%
M: 13 C: 0
0%
M: 1 C: 0
0%
getAge()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getCustom()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getFirstName()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getGender()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getLastName()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
setAge(Integer)
M: 21 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
setCustom(String)
M: 21 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
setFirstName(String)
M: 21 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
setGender(Gender)
M: 25 C: 0
0%
M: 4 C: 0
0%
M: 3 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
setLastName(String)
M: 21 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 6 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 11 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 C: 0
0%
M: 1 C: 0
0%
toString()
M: 64 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 15 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /**
2: * Copyright (c) 2011-2014 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: * Eugen Neufeld - initial API and implementation
13: */
14: package org.eclipse.emf.ecp.view.validation.test.model.impl;
15:
16: import org.eclipse.emf.common.notify.Notification;
17: import org.eclipse.emf.ecore.EClass;
18: import org.eclipse.emf.ecore.impl.ENotificationImpl;
19: import org.eclipse.emf.ecore.impl.EObjectImpl;
20: import org.eclipse.emf.ecp.view.validation.test.model.Gender;
21: import org.eclipse.emf.ecp.view.validation.test.model.Person;
22: import org.eclipse.emf.ecp.view.validation.test.model.TestPackage;
23:
24: /**
25: * <!-- begin-user-doc -->
26: * An implementation of the model object '<em><b>Person</b></em>'.
27: * <!-- end-user-doc -->
28: * <p>
29: * The following features are implemented:
30: * </p>
31: * <ul>
32: * <li>{@link org.eclipse.emf.ecp.view.validation.test.model.impl.PersonImpl#getFirstName <em>First Name</em>}</li>
33: * <li>{@link org.eclipse.emf.ecp.view.validation.test.model.impl.PersonImpl#getGender <em>Gender</em>}</li>
34: * <li>{@link org.eclipse.emf.ecp.view.validation.test.model.impl.PersonImpl#getLastName <em>Last Name</em>}</li>
35: * <li>{@link org.eclipse.emf.ecp.view.validation.test.model.impl.PersonImpl#getCustom <em>Custom</em>}</li>
36: * <li>{@link org.eclipse.emf.ecp.view.validation.test.model.impl.PersonImpl#getAge <em>Age</em>}</li>
37: * </ul>
38: *
39: * @generated
40: */
41: public class PersonImpl extends EObjectImpl implements Person {
42:         /**
43:          * The default value of the '{@link #getFirstName() <em>First Name</em>}' attribute.
44:          * <!-- begin-user-doc -->
45:          * <!-- end-user-doc -->
46:          *
47:          * @see #getFirstName()
48:          * @generated
49:          * @ordered
50:          */
51:         protected static final String FIRST_NAME_EDEFAULT = null;
52:         /**
53:          * The cached value of the '{@link #getFirstName() <em>First Name</em>}' attribute.
54:          * <!-- begin-user-doc -->
55:          * <!-- end-user-doc -->
56:          *
57:          * @see #getFirstName()
58:          * @generated
59:          * @ordered
60:          */
61:         protected String firstName = FIRST_NAME_EDEFAULT;
62:
63:         /**
64:          * The default value of the '{@link #getGender() <em>Gender</em>}' attribute.
65:          * <!-- begin-user-doc -->
66:          * <!-- end-user-doc -->
67:          *
68:          * @see #getGender()
69:          * @generated
70:          * @ordered
71:          */
72:         protected static final Gender GENDER_EDEFAULT = Gender.MALE;
73:         /**
74:          * The cached value of the '{@link #getGender() <em>Gender</em>}' attribute.
75:          * <!-- begin-user-doc -->
76:          * <!-- end-user-doc -->
77:          *
78:          * @see #getGender()
79:          * @generated
80:          * @ordered
81:          */
82:         protected Gender gender = GENDER_EDEFAULT;
83:
84:         /**
85:          * The default value of the '{@link #getLastName() <em>Last Name</em>}' attribute.
86:          * <!-- begin-user-doc -->
87:          * <!-- end-user-doc -->
88:          *
89:          * @see #getLastName()
90:          * @generated
91:          * @ordered
92:          */
93:         protected static final String LAST_NAME_EDEFAULT = null;
94:         /**
95:          * The cached value of the '{@link #getLastName() <em>Last Name</em>}' attribute.
96:          * <!-- begin-user-doc -->
97:          * <!-- end-user-doc -->
98:          *
99:          * @see #getLastName()
100:          * @generated
101:          * @ordered
102:          */
103:         protected String lastName = LAST_NAME_EDEFAULT;
104:
105:         /**
106:          * The default value of the '{@link #getCustom() <em>Custom</em>}' attribute.
107:          * <!-- begin-user-doc -->
108:          * <!-- end-user-doc -->
109:          *
110:          * @see #getCustom()
111:          * @generated
112:          * @ordered
113:          */
114:         protected static final String CUSTOM_EDEFAULT = null;
115:         /**
116:          * The cached value of the '{@link #getCustom() <em>Custom</em>}' attribute.
117:          * <!-- begin-user-doc -->
118:          * <!-- end-user-doc -->
119:          *
120:          * @see #getCustom()
121:          * @generated
122:          * @ordered
123:          */
124:         protected String custom = CUSTOM_EDEFAULT;
125:         /**
126:          * The default value of the '{@link #getAge() <em>Age</em>}' attribute.
127:          * <!-- begin-user-doc -->
128:          * <!-- end-user-doc -->
129:          *
130:          * @see #getAge()
131:          * @generated
132:          * @ordered
133:          */
134:         protected static final Integer AGE_EDEFAULT = null;
135:         /**
136:          * The cached value of the '{@link #getAge() <em>Age</em>}' attribute.
137:          * <!-- begin-user-doc -->
138:          * <!-- end-user-doc -->
139:          *
140:          * @see #getAge()
141:          * @generated
142:          * @ordered
143:          */
144:         protected Integer age = AGE_EDEFAULT;
145:
146:         /**
147:          * <!-- begin-user-doc -->
148:          * <!-- end-user-doc -->
149:          *
150:          * @generated
151:          */
152:         protected PersonImpl() {
153:                 super();
154:         }
155:
156:         /**
157:          * <!-- begin-user-doc -->
158:          * <!-- end-user-doc -->
159:          *
160:          * @generated
161:          */
162:         @Override
163:         protected EClass eStaticClass() {
164:                 return TestPackage.Literals.PERSON;
165:         }
166:
167:         /**
168:          * <!-- begin-user-doc -->
169:          * <!-- end-user-doc -->
170:          *
171:          * @generated
172:          */
173:         @Override
174:         public String getFirstName() {
175:                 return firstName;
176:         }
177:
178:         /**
179:          * <!-- begin-user-doc -->
180:          * <!-- end-user-doc -->
181:          *
182:          * @generated
183:          */
184:         @Override
185:         public void setFirstName(String newFirstName) {
186:                 final String oldFirstName = firstName;
187:                 firstName = newFirstName;
188:•                if (eNotificationRequired()) {
189:                         eNotify(
190:                                 new ENotificationImpl(this, Notification.SET, TestPackage.PERSON__FIRST_NAME, oldFirstName, firstName));
191:                 }
192:         }
193:
194:         /**
195:          * <!-- begin-user-doc -->
196:          * <!-- end-user-doc -->
197:          *
198:          * @generated
199:          */
200:         @Override
201:         public Gender getGender() {
202:                 return gender;
203:         }
204:
205:         /**
206:          * <!-- begin-user-doc -->
207:          * <!-- end-user-doc -->
208:          *
209:          * @generated
210:          */
211:         @Override
212:         public void setGender(Gender newGender) {
213:                 final Gender oldGender = gender;
214:•                gender = newGender == null ? GENDER_EDEFAULT : newGender;
215:•                if (eNotificationRequired()) {
216:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.PERSON__GENDER, oldGender, gender));
217:                 }
218:         }
219:
220:         /**
221:          * <!-- begin-user-doc -->
222:          * <!-- end-user-doc -->
223:          *
224:          * @generated
225:          */
226:         @Override
227:         public String getLastName() {
228:                 return lastName;
229:         }
230:
231:         /**
232:          * <!-- begin-user-doc -->
233:          * <!-- end-user-doc -->
234:          *
235:          * @generated
236:          */
237:         @Override
238:         public void setLastName(String newLastName) {
239:                 final String oldLastName = lastName;
240:                 lastName = newLastName;
241:•                if (eNotificationRequired()) {
242:                         eNotify(
243:                                 new ENotificationImpl(this, Notification.SET, TestPackage.PERSON__LAST_NAME, oldLastName, lastName));
244:                 }
245:         }
246:
247:         /**
248:          * <!-- begin-user-doc -->
249:          * <!-- end-user-doc -->
250:          *
251:          * @generated
252:          */
253:         @Override
254:         public String getCustom() {
255:                 return custom;
256:         }
257:
258:         /**
259:          * <!-- begin-user-doc -->
260:          * <!-- end-user-doc -->
261:          *
262:          * @generated
263:          */
264:         @Override
265:         public void setCustom(String newCustom) {
266:                 final String oldCustom = custom;
267:                 custom = newCustom;
268:•                if (eNotificationRequired()) {
269:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.PERSON__CUSTOM, oldCustom, custom));
270:                 }
271:         }
272:
273:         /**
274:          * <!-- begin-user-doc -->
275:          * <!-- end-user-doc -->
276:          *
277:          * @generated
278:          */
279:         @Override
280:         public Integer getAge() {
281:                 return age;
282:         }
283:
284:         /**
285:          * <!-- begin-user-doc -->
286:          * <!-- end-user-doc -->
287:          *
288:          * @generated
289:          */
290:         @Override
291:         public void setAge(Integer newAge) {
292:                 final Integer oldAge = age;
293:                 age = newAge;
294:•                if (eNotificationRequired()) {
295:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.PERSON__AGE, oldAge, age));
296:                 }
297:         }
298:
299:         /**
300:          * <!-- begin-user-doc -->
301:          * <!-- end-user-doc -->
302:          *
303:          * @generated
304:          */
305:         @Override
306:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
307:•                switch (featureID) {
308:                 case TestPackage.PERSON__FIRST_NAME:
309:                         return getFirstName();
310:                 case TestPackage.PERSON__GENDER:
311:                         return getGender();
312:                 case TestPackage.PERSON__LAST_NAME:
313:                         return getLastName();
314:                 case TestPackage.PERSON__CUSTOM:
315:                         return getCustom();
316:                 case TestPackage.PERSON__AGE:
317:                         return getAge();
318:                 }
319:                 return super.eGet(featureID, resolve, coreType);
320:         }
321:
322:         /**
323:          * <!-- begin-user-doc -->
324:          * <!-- end-user-doc -->
325:          *
326:          * @generated
327:          */
328:         @Override
329:         public void eSet(int featureID, Object newValue) {
330:•                switch (featureID) {
331:                 case TestPackage.PERSON__FIRST_NAME:
332:                         setFirstName((String) newValue);
333:                         return;
334:                 case TestPackage.PERSON__GENDER:
335:                         setGender((Gender) newValue);
336:                         return;
337:                 case TestPackage.PERSON__LAST_NAME:
338:                         setLastName((String) newValue);
339:                         return;
340:                 case TestPackage.PERSON__CUSTOM:
341:                         setCustom((String) newValue);
342:                         return;
343:                 case TestPackage.PERSON__AGE:
344:                         setAge((Integer) newValue);
345:                         return;
346:                 }
347:                 super.eSet(featureID, newValue);
348:         }
349:
350:         /**
351:          * <!-- begin-user-doc -->
352:          * <!-- end-user-doc -->
353:          *
354:          * @generated
355:          */
356:         @Override
357:         public void eUnset(int featureID) {
358:•                switch (featureID) {
359:                 case TestPackage.PERSON__FIRST_NAME:
360:                         setFirstName(FIRST_NAME_EDEFAULT);
361:                         return;
362:                 case TestPackage.PERSON__GENDER:
363:                         setGender(GENDER_EDEFAULT);
364:                         return;
365:                 case TestPackage.PERSON__LAST_NAME:
366:                         setLastName(LAST_NAME_EDEFAULT);
367:                         return;
368:                 case TestPackage.PERSON__CUSTOM:
369:                         setCustom(CUSTOM_EDEFAULT);
370:                         return;
371:                 case TestPackage.PERSON__AGE:
372:                         setAge(AGE_EDEFAULT);
373:                         return;
374:                 }
375:                 super.eUnset(featureID);
376:         }
377:
378:         /**
379:          * <!-- begin-user-doc -->
380:          * <!-- end-user-doc -->
381:          *
382:          * @generated
383:          */
384:         @Override
385:         public boolean eIsSet(int featureID) {
386:•                switch (featureID) {
387:                 case TestPackage.PERSON__FIRST_NAME:
388:•                        return FIRST_NAME_EDEFAULT == null ? firstName != null : !FIRST_NAME_EDEFAULT.equals(firstName);
389:                 case TestPackage.PERSON__GENDER:
390:•                        return gender != GENDER_EDEFAULT;
391:                 case TestPackage.PERSON__LAST_NAME:
392:•                        return LAST_NAME_EDEFAULT == null ? lastName != null : !LAST_NAME_EDEFAULT.equals(lastName);
393:                 case TestPackage.PERSON__CUSTOM:
394:•                        return CUSTOM_EDEFAULT == null ? custom != null : !CUSTOM_EDEFAULT.equals(custom);
395:                 case TestPackage.PERSON__AGE:
396:•                        return AGE_EDEFAULT == null ? age != null : !AGE_EDEFAULT.equals(age);
397:                 }
398:                 return super.eIsSet(featureID);
399:         }
400:
401:         /**
402:          * <!-- begin-user-doc -->
403:          * <!-- end-user-doc -->
404:          *
405:          * @generated
406:          */
407:         @Override
408:         public String toString() {
409:•                if (eIsProxy()) {
410:                         return super.toString();
411:                 }
412:
413:                 final StringBuffer result = new StringBuffer(super.toString());
414:                 result.append(" (firstName: ");
415:                 result.append(firstName);
416:                 result.append(", gender: ");
417:                 result.append(gender);
418:                 result.append(", lastName: ");
419:                 result.append(lastName);
420:                 result.append(", custom: ");
421:                 result.append(custom);
422:                 result.append(", age: ");
423:                 result.append(age);
424:                 result.append(')');
425:                 return result.toString();
426:         }
427:
428: } // PersonImpl