Skip to content

Package: WriterImpl

WriterImpl

nameinstructionbranchcomplexitylinemethod
WriterImpl()
M: 0 C: 18
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 7
100%
M: 0 C: 1
100%
basicSetLibrary(Library, NotificationChain)
M: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
eBasicRemoveFromContainerFeature(NotificationChain)
M: 15 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
eGet(int, boolean, boolean)
M: 19 C: 11
37%
M: 5 C: 3
38%
M: 5 C: 3
38%
M: 5 C: 4
44%
M: 0 C: 1
100%
eInverseAdd(InternalEObject, int, NotificationChain)
M: 17 C: 11
39%
M: 3 C: 2
40%
M: 3 C: 1
25%
M: 3 C: 3
50%
M: 0 C: 1
100%
eInverseRemove(InternalEObject, int, NotificationChain)
M: 20 C: 0
0%
M: 3 C: 0
0%
M: 3 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
eIsSet(int)
M: 49 C: 50
51%
M: 19 C: 19
50%
M: 14 C: 9
39%
M: 2 C: 7
78%
M: 0 C: 1
100%
eSet(int, Object)
M: 41 C: 7
15%
M: 7 C: 1
13%
M: 7 C: 1
13%
M: 15 C: 3
17%
M: 0 C: 1
100%
eStaticClass()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
eUnset(int)
M: 34 C: 0
0%
M: 8 C: 0
0%
M: 8 C: 0
0%
M: 17 C: 0
0%
M: 1 C: 0
0%
getBirthDate()
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%
getBooks()
M: 0 C: 15
100%
M: 0 C: 2
100%
M: 0 C: 2
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
getEMail()
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: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getLastName()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getLibrary()
M: 10 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
isPseudonym()
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%
setBirthDate(Date)
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%
setEMail(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: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%
setLastName(String)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 2 C: 4
67%
M: 0 C: 1
100%
setLibrary(Library)
M: 69 C: 0
0%
M: 16 C: 0
0%
M: 9 C: 0
0%
M: 16 C: 0
0%
M: 1 C: 0
0%
setPseudonym(boolean)
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: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
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%
validate(DiagnosticChain, Map)
M: 0 C: 102
100%
M: 4 C: 10
71%
M: 4 C: 4
50%
M: 0 C: 20
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 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: * Johannes Faltermeier
14: *
15: *******************************************************************************/
16: package org.eclipse.emf.ecp.validation.test.test.impl;
17:
18: import java.util.Collection;
19: import java.util.Date;
20: import java.util.Map;
21:
22: import org.eclipse.emf.common.notify.Notification;
23: import org.eclipse.emf.common.notify.NotificationChain;
24: import org.eclipse.emf.common.util.BasicDiagnostic;
25: import org.eclipse.emf.common.util.Diagnostic;
26: import org.eclipse.emf.common.util.DiagnosticChain;
27: import org.eclipse.emf.common.util.EList;
28: import org.eclipse.emf.ecore.EClass;
29: import org.eclipse.emf.ecore.InternalEObject;
30: import org.eclipse.emf.ecore.impl.ENotificationImpl;
31: import org.eclipse.emf.ecore.impl.EObjectImpl;
32: import org.eclipse.emf.ecore.plugin.EcorePlugin;
33: import org.eclipse.emf.ecore.util.EObjectValidator;
34: import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
35: import org.eclipse.emf.ecore.util.EcoreUtil;
36: import org.eclipse.emf.ecore.util.InternalEList;
37: import org.eclipse.emf.ecp.validation.test.test.Book;
38: import org.eclipse.emf.ecp.validation.test.test.Library;
39: import org.eclipse.emf.ecp.validation.test.test.TestPackage;
40: import org.eclipse.emf.ecp.validation.test.test.Writer;
41: import org.eclipse.emf.ecp.validation.test.test.util.TestValidator;
42:
43: /**
44: * <!-- begin-user-doc -->
45: * An implementation of the model object '<em><b>Writer</b></em>'.
46: * <!-- end-user-doc -->
47: * <p>
48: * The following features are implemented:
49: * <ul>
50: * <li>{@link org.eclipse.emf.ecp.validation.test.test.impl.WriterImpl#getFirstName <em>First Name</em>}</li>
51: * <li>{@link org.eclipse.emf.ecp.validation.test.test.impl.WriterImpl#getLastName <em>Last Name</em>}</li>
52: * <li>{@link org.eclipse.emf.ecp.validation.test.test.impl.WriterImpl#getEMail <em>EMail</em>}</li>
53: * <li>{@link org.eclipse.emf.ecp.validation.test.test.impl.WriterImpl#getBirthDate <em>Birth Date</em>}</li>
54: * <li>{@link org.eclipse.emf.ecp.validation.test.test.impl.WriterImpl#getBooks <em>Books</em>}</li>
55: * <li>{@link org.eclipse.emf.ecp.validation.test.test.impl.WriterImpl#isPseudonym <em>Pseudonym</em>}</li>
56: * <li>{@link org.eclipse.emf.ecp.validation.test.test.impl.WriterImpl#getLibrary <em>Library</em>}</li>
57: * </ul>
58: * </p>
59: *
60: * @generated
61: */
62: public class WriterImpl extends EObjectImpl implements Writer {
63:         /**
64:          * The default value of the '{@link #getFirstName() <em>First Name</em>}' attribute.
65:          * <!-- begin-user-doc -->
66:          * <!-- end-user-doc -->
67:          *
68:          * @see #getFirstName()
69:          * @generated
70:          * @ordered
71:          */
72:         protected static final String FIRST_NAME_EDEFAULT = null;
73:
74:         /**
75:          * The cached value of the '{@link #getFirstName() <em>First Name</em>}' attribute.
76:          * <!-- begin-user-doc -->
77:          * <!-- end-user-doc -->
78:          *
79:          * @see #getFirstName()
80:          * @generated
81:          * @ordered
82:          */
83:         protected String firstName = FIRST_NAME_EDEFAULT;
84:
85:         /**
86:          * The default value of the '{@link #getLastName() <em>Last Name</em>}' attribute.
87:          * <!-- begin-user-doc -->
88:          * <!-- end-user-doc -->
89:          *
90:          * @see #getLastName()
91:          * @generated
92:          * @ordered
93:          */
94:         protected static final String LAST_NAME_EDEFAULT = null;
95:
96:         /**
97:          * The cached value of the '{@link #getLastName() <em>Last Name</em>}' attribute.
98:          * <!-- begin-user-doc -->
99:          * <!-- end-user-doc -->
100:          *
101:          * @see #getLastName()
102:          * @generated
103:          * @ordered
104:          */
105:         protected String lastName = LAST_NAME_EDEFAULT;
106:
107:         /**
108:          * The default value of the '{@link #getEMail() <em>EMail</em>}' attribute.
109:          * <!-- begin-user-doc -->
110:          * <!-- end-user-doc -->
111:          *
112:          * @see #getEMail()
113:          * @generated
114:          * @ordered
115:          */
116:         protected static final String EMAIL_EDEFAULT = null;
117:
118:         /**
119:          * The cached value of the '{@link #getEMail() <em>EMail</em>}' attribute.
120:          * <!-- begin-user-doc -->
121:          * <!-- end-user-doc -->
122:          *
123:          * @see #getEMail()
124:          * @generated
125:          * @ordered
126:          */
127:         protected String eMail = EMAIL_EDEFAULT;
128:
129:         /**
130:          * The default value of the '{@link #getBirthDate() <em>Birth Date</em>}' attribute.
131:          * <!-- begin-user-doc -->
132:          * <!-- end-user-doc -->
133:          *
134:          * @see #getBirthDate()
135:          * @generated
136:          * @ordered
137:          */
138:         protected static final Date BIRTH_DATE_EDEFAULT = null;
139:
140:         /**
141:          * The cached value of the '{@link #getBirthDate() <em>Birth Date</em>}' attribute.
142:          * <!-- begin-user-doc -->
143:          * <!-- end-user-doc -->
144:          *
145:          * @see #getBirthDate()
146:          * @generated
147:          * @ordered
148:          */
149:         protected Date birthDate = BIRTH_DATE_EDEFAULT;
150:
151:         /**
152:          * The cached value of the '{@link #getBooks() <em>Books</em>}' reference list.
153:          * <!-- begin-user-doc -->
154:          * <!-- end-user-doc -->
155:          *
156:          * @see #getBooks()
157:          * @generated
158:          * @ordered
159:          */
160:         protected EList<Book> books;
161:
162:         /**
163:          * The default value of the '{@link #isPseudonym() <em>Pseudonym</em>}' attribute.
164:          * <!-- begin-user-doc -->
165:          * <!-- end-user-doc -->
166:          *
167:          * @see #isPseudonym()
168:          * @generated
169:          * @ordered
170:          */
171:         protected static final boolean PSEUDONYM_EDEFAULT = false;
172:
173:         /**
174:          * The cached value of the '{@link #isPseudonym() <em>Pseudonym</em>}' attribute.
175:          * <!-- begin-user-doc -->
176:          * <!-- end-user-doc -->
177:          *
178:          * @see #isPseudonym()
179:          * @generated
180:          * @ordered
181:          */
182:         protected boolean pseudonym = PSEUDONYM_EDEFAULT;
183:
184:         /**
185:          * <!-- begin-user-doc -->
186:          * <!-- end-user-doc -->
187:          *
188:          * @generated
189:          */
190:         protected WriterImpl() {
191:                 super();
192:         }
193:
194:         /**
195:          * <!-- begin-user-doc -->
196:          * <!-- end-user-doc -->
197:          *
198:          * @generated
199:          */
200:         @Override
201:         protected EClass eStaticClass() {
202:                 return TestPackage.Literals.WRITER;
203:         }
204:
205:         /**
206:          * <!-- begin-user-doc -->
207:          * <!-- end-user-doc -->
208:          *
209:          * @generated
210:          */
211:         @Override
212:         public String getFirstName() {
213:                 return firstName;
214:         }
215:
216:         /**
217:          * <!-- begin-user-doc -->
218:          * <!-- end-user-doc -->
219:          *
220:          * @generated
221:          */
222:         @Override
223:         public void setFirstName(String newFirstName) {
224:                 final String oldFirstName = firstName;
225:                 firstName = newFirstName;
226:•                if (eNotificationRequired()) {
227:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.WRITER__FIRST_NAME, oldFirstName,
228:                                 firstName));
229:                 }
230:         }
231:
232:         /**
233:          * <!-- begin-user-doc -->
234:          * <!-- end-user-doc -->
235:          *
236:          * @generated
237:          */
238:         @Override
239:         public String getLastName() {
240:                 return lastName;
241:         }
242:
243:         /**
244:          * <!-- begin-user-doc -->
245:          * <!-- end-user-doc -->
246:          *
247:          * @generated
248:          */
249:         @Override
250:         public void setLastName(String newLastName) {
251:                 final String oldLastName = lastName;
252:                 lastName = newLastName;
253:•                if (eNotificationRequired()) {
254:                         eNotify(
255:                                 new ENotificationImpl(this, Notification.SET, TestPackage.WRITER__LAST_NAME, oldLastName, lastName));
256:                 }
257:         }
258:
259:         /**
260:          * <!-- begin-user-doc -->
261:          * <!-- end-user-doc -->
262:          *
263:          * @generated
264:          */
265:         @Override
266:         public String getEMail() {
267:                 return eMail;
268:         }
269:
270:         /**
271:          * <!-- begin-user-doc -->
272:          * <!-- end-user-doc -->
273:          *
274:          * @generated
275:          */
276:         @Override
277:         public void setEMail(String newEMail) {
278:                 final String oldEMail = eMail;
279:                 eMail = newEMail;
280:•                if (eNotificationRequired()) {
281:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.WRITER__EMAIL, oldEMail, eMail));
282:                 }
283:         }
284:
285:         /**
286:          * <!-- begin-user-doc -->
287:          * <!-- end-user-doc -->
288:          *
289:          * @generated
290:          */
291:         @Override
292:         public Date getBirthDate() {
293:                 return birthDate;
294:         }
295:
296:         /**
297:          * <!-- begin-user-doc -->
298:          * <!-- end-user-doc -->
299:          *
300:          * @generated
301:          */
302:         @Override
303:         public void setBirthDate(Date newBirthDate) {
304:                 final Date oldBirthDate = birthDate;
305:                 birthDate = newBirthDate;
306:•                if (eNotificationRequired()) {
307:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.WRITER__BIRTH_DATE, oldBirthDate,
308:                                 birthDate));
309:                 }
310:         }
311:
312:         /**
313:          * <!-- begin-user-doc -->
314:          * <!-- end-user-doc -->
315:          *
316:          * @generated
317:          */
318:         @Override
319:         public EList<Book> getBooks() {
320:•                if (books == null) {
321:                         books = new EObjectWithInverseResolvingEList<Book>(Book.class, this, TestPackage.WRITER__BOOKS,
322:                                 TestPackage.BOOK__WRITERS);
323:                 }
324:                 return books;
325:         }
326:
327:         /**
328:          * <!-- begin-user-doc -->
329:          * <!-- end-user-doc -->
330:          *
331:          * @generated
332:          */
333:         @Override
334:         public boolean isPseudonym() {
335:                 return pseudonym;
336:         }
337:
338:         /**
339:          * <!-- begin-user-doc -->
340:          * <!-- end-user-doc -->
341:          *
342:          * @generated
343:          */
344:         @Override
345:         public void setPseudonym(boolean newPseudonym) {
346:                 final boolean oldPseudonym = pseudonym;
347:                 pseudonym = newPseudonym;
348:•                if (eNotificationRequired()) {
349:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.WRITER__PSEUDONYM, oldPseudonym,
350:                                 pseudonym));
351:                 }
352:         }
353:
354:         /**
355:          * <!-- begin-user-doc -->
356:          * <!-- end-user-doc -->
357:          *
358:          * @generated
359:          */
360:         @Override
361:         public Library getLibrary() {
362:•                if (eContainerFeatureID() != TestPackage.WRITER__LIBRARY) {
363:                         return null;
364:                 }
365:                 return (Library) eContainer();
366:         }
367:
368:         /**
369:          * <!-- begin-user-doc -->
370:          * <!-- end-user-doc -->
371:          *
372:          * @generated
373:          */
374:         public NotificationChain basicSetLibrary(Library newLibrary, NotificationChain msgs) {
375:                 msgs = eBasicSetContainer((InternalEObject) newLibrary, TestPackage.WRITER__LIBRARY, msgs);
376:                 return msgs;
377:         }
378:
379:         /**
380:          * <!-- begin-user-doc -->
381:          * <!-- end-user-doc -->
382:          *
383:          * @generated
384:          */
385:         @Override
386:         public void setLibrary(Library newLibrary) {
387:•                if (newLibrary != eInternalContainer() || eContainerFeatureID() != TestPackage.WRITER__LIBRARY
388:•                        && newLibrary != null) {
389:•                        if (EcoreUtil.isAncestor(this, newLibrary)) {
390:                                 throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
391:                         }
392:                         NotificationChain msgs = null;
393:•                        if (eInternalContainer() != null) {
394:                                 msgs = eBasicRemoveFromContainer(msgs);
395:                         }
396:•                        if (newLibrary != null) {
397:                                 msgs = ((InternalEObject) newLibrary).eInverseAdd(this, TestPackage.LIBRARY__WRITERS, Library.class,
398:                                         msgs);
399:                         }
400:                         msgs = basicSetLibrary(newLibrary, msgs);
401:•                        if (msgs != null) {
402:                                 msgs.dispatch();
403:                         }
404:•                } else if (eNotificationRequired()) {
405:                         eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.WRITER__LIBRARY, newLibrary, newLibrary));
406:                 }
407:         }
408:
409:         /**
410:          * <!-- begin-user-doc -->
411:          * <!-- end-user-doc -->
412:          *
413:          * @generated NOT
414:          */
415:         @Override
416:         public boolean validate(DiagnosticChain diagnostic, Map<Object, Object> context) {
417:                 // TODO: implement this method
418:                 // -> specify the condition that violates the invariant
419:                 // -> verify the details of the diagnostic, including severity and message
420:                 // Ensure that you remove @generated or mark it @generated NOT
421:•                if (getFirstName() == null || getFirstName().length() == 0) {
422:•                        if (diagnostic != null) {
423:                                 diagnostic.add(new BasicDiagnostic(Diagnostic.ERROR, TestValidator.DIAGNOSTIC_SOURCE,
424:                                         TestValidator.WRITER__VALIDATE, EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic",
425:                                                 new Object[] { "validate", EObjectValidator.getObjectLabel(this, context) }),
426:                                         new Object[] {
427:                                                 this, TestPackage.eINSTANCE.getWriter_FirstName() }));
428:                         }
429:                         return false;
430:                 }
431:                 // warning when firstname equals lastname
432:•                else if (getFirstName() != null && getLastName() != null && getLastName().equals(getFirstName())) {
433:•                        if (diagnostic != null) {
434:                                 diagnostic
435:                                         .add(new BasicDiagnostic(Diagnostic.WARNING, TestValidator.DIAGNOSTIC_SOURCE,
436:                                                 TestValidator.WRITER__VALIDATE, EcorePlugin.INSTANCE.getString(
437:                                                         "_UI_GenericInvariant_diagnostic",
438:                                                         new Object[] { "validate", EObjectValidator.getObjectLabel(this, context) }),
439:                                                 new Object[] {
440:                                                         this, TestPackage.eINSTANCE.getWriter_FirstName(),
441:                                                         TestPackage.eINSTANCE.getWriter_LastName() }));
442:                         }
443:                         return false;
444:                 }
445:                 return true;
446:         }
447:
448:         /**
449:          * <!-- begin-user-doc -->
450:          * <!-- end-user-doc -->
451:          *
452:          * @generated
453:          */
454:         @SuppressWarnings("unchecked")
455:         @Override
456:         public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
457:•                switch (featureID) {
458:                 case TestPackage.WRITER__BOOKS:
459:                         return ((InternalEList<InternalEObject>) (InternalEList<?>) getBooks()).basicAdd(otherEnd, msgs);
460:                 case TestPackage.WRITER__LIBRARY:
461:•                        if (eInternalContainer() != null) {
462:                                 msgs = eBasicRemoveFromContainer(msgs);
463:                         }
464:                         return basicSetLibrary((Library) otherEnd, msgs);
465:                 }
466:                 return super.eInverseAdd(otherEnd, featureID, msgs);
467:         }
468:
469:         /**
470:          * <!-- begin-user-doc -->
471:          * <!-- end-user-doc -->
472:          *
473:          * @generated
474:          */
475:         @Override
476:         public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
477:•                switch (featureID) {
478:                 case TestPackage.WRITER__BOOKS:
479:                         return ((InternalEList<?>) getBooks()).basicRemove(otherEnd, msgs);
480:                 case TestPackage.WRITER__LIBRARY:
481:                         return basicSetLibrary(null, msgs);
482:                 }
483:                 return super.eInverseRemove(otherEnd, featureID, msgs);
484:         }
485:
486:         /**
487:          * <!-- begin-user-doc -->
488:          * <!-- end-user-doc -->
489:          *
490:          * @generated
491:          */
492:         @Override
493:         public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
494:•                switch (eContainerFeatureID()) {
495:                 case TestPackage.WRITER__LIBRARY:
496:                         return eInternalContainer().eInverseRemove(this, TestPackage.LIBRARY__WRITERS, Library.class, msgs);
497:                 }
498:                 return super.eBasicRemoveFromContainerFeature(msgs);
499:         }
500:
501:         /**
502:          * <!-- begin-user-doc -->
503:          * <!-- end-user-doc -->
504:          *
505:          * @generated
506:          */
507:         @Override
508:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
509:•                switch (featureID) {
510:                 case TestPackage.WRITER__FIRST_NAME:
511:                         return getFirstName();
512:                 case TestPackage.WRITER__LAST_NAME:
513:                         return getLastName();
514:                 case TestPackage.WRITER__EMAIL:
515:                         return getEMail();
516:                 case TestPackage.WRITER__BIRTH_DATE:
517:                         return getBirthDate();
518:                 case TestPackage.WRITER__BOOKS:
519:                         return getBooks();
520:                 case TestPackage.WRITER__PSEUDONYM:
521:                         return isPseudonym();
522:                 case TestPackage.WRITER__LIBRARY:
523:                         return getLibrary();
524:                 }
525:                 return super.eGet(featureID, resolve, coreType);
526:         }
527:
528:         /**
529:          * <!-- begin-user-doc -->
530:          * <!-- end-user-doc -->
531:          *
532:          * @generated
533:          */
534:         @SuppressWarnings("unchecked")
535:         @Override
536:         public void eSet(int featureID, Object newValue) {
537:•                switch (featureID) {
538:                 case TestPackage.WRITER__FIRST_NAME:
539:                         setFirstName((String) newValue);
540:                         return;
541:                 case TestPackage.WRITER__LAST_NAME:
542:                         setLastName((String) newValue);
543:                         return;
544:                 case TestPackage.WRITER__EMAIL:
545:                         setEMail((String) newValue);
546:                         return;
547:                 case TestPackage.WRITER__BIRTH_DATE:
548:                         setBirthDate((Date) newValue);
549:                         return;
550:                 case TestPackage.WRITER__BOOKS:
551:                         getBooks().clear();
552:                         getBooks().addAll((Collection<? extends Book>) newValue);
553:                         return;
554:                 case TestPackage.WRITER__PSEUDONYM:
555:                         setPseudonym((Boolean) newValue);
556:                         return;
557:                 case TestPackage.WRITER__LIBRARY:
558:                         setLibrary((Library) newValue);
559:                         return;
560:                 }
561:                 super.eSet(featureID, newValue);
562:         }
563:
564:         /**
565:          * <!-- begin-user-doc -->
566:          * <!-- end-user-doc -->
567:          *
568:          * @generated
569:          */
570:         @Override
571:         public void eUnset(int featureID) {
572:•                switch (featureID) {
573:                 case TestPackage.WRITER__FIRST_NAME:
574:                         setFirstName(FIRST_NAME_EDEFAULT);
575:                         return;
576:                 case TestPackage.WRITER__LAST_NAME:
577:                         setLastName(LAST_NAME_EDEFAULT);
578:                         return;
579:                 case TestPackage.WRITER__EMAIL:
580:                         setEMail(EMAIL_EDEFAULT);
581:                         return;
582:                 case TestPackage.WRITER__BIRTH_DATE:
583:                         setBirthDate(BIRTH_DATE_EDEFAULT);
584:                         return;
585:                 case TestPackage.WRITER__BOOKS:
586:                         getBooks().clear();
587:                         return;
588:                 case TestPackage.WRITER__PSEUDONYM:
589:                         setPseudonym(PSEUDONYM_EDEFAULT);
590:                         return;
591:                 case TestPackage.WRITER__LIBRARY:
592:                         setLibrary((Library) null);
593:                         return;
594:                 }
595:                 super.eUnset(featureID);
596:         }
597:
598:         /**
599:          * <!-- begin-user-doc -->
600:          * <!-- end-user-doc -->
601:          *
602:          * @generated
603:          */
604:         @Override
605:         public boolean eIsSet(int featureID) {
606:•                switch (featureID) {
607:                 case TestPackage.WRITER__FIRST_NAME:
608:•                        return FIRST_NAME_EDEFAULT == null ? firstName != null : !FIRST_NAME_EDEFAULT.equals(firstName);
609:                 case TestPackage.WRITER__LAST_NAME:
610:•                        return LAST_NAME_EDEFAULT == null ? lastName != null : !LAST_NAME_EDEFAULT.equals(lastName);
611:                 case TestPackage.WRITER__EMAIL:
612:•                        return EMAIL_EDEFAULT == null ? eMail != null : !EMAIL_EDEFAULT.equals(eMail);
613:                 case TestPackage.WRITER__BIRTH_DATE:
614:•                        return BIRTH_DATE_EDEFAULT == null ? birthDate != null : !BIRTH_DATE_EDEFAULT.equals(birthDate);
615:                 case TestPackage.WRITER__BOOKS:
616:•                        return books != null && !books.isEmpty();
617:                 case TestPackage.WRITER__PSEUDONYM:
618:                         return pseudonym != PSEUDONYM_EDEFAULT;
619:                 case TestPackage.WRITER__LIBRARY:
620:•                        return getLibrary() != null;
621:                 }
622:                 return super.eIsSet(featureID);
623:         }
624:
625:         /**
626:          * <!-- begin-user-doc -->
627:          * <!-- end-user-doc -->
628:          *
629:          * @generated
630:          */
631:         @Override
632:         public String toString() {
633:•                if (eIsProxy()) {
634:                         return super.toString();
635:                 }
636:
637:                 final StringBuffer result = new StringBuffer(super.toString());
638:                 result.append(" (firstName: ");
639:                 result.append(firstName);
640:                 result.append(", lastName: ");
641:                 result.append(lastName);
642:                 result.append(", EMail: ");
643:                 result.append(eMail);
644:                 result.append(", BirthDate: ");
645:                 result.append(birthDate);
646:                 result.append(", Pseudonym: ");
647:                 result.append(pseudonym);
648:                 result.append(')');
649:                 return result.toString();
650:         }
651:
652: } // WriterImpl