Skip to content

Package: UserImpl

UserImpl

nameinstructionbranchcomplexitylinemethod
UserImpl()
M: 0 C: 12
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
eGet(int, boolean, boolean)
M: 18 C: 5
22%
M: 5 C: 1
17%
M: 5 C: 1
17%
M: 5 C: 2
29%
M: 0 C: 1
100%
eIsSet(int)
M: 46 C: 36
44%
M: 19 C: 13
41%
M: 14 C: 5
26%
M: 1 C: 6
86%
M: 0 C: 1
100%
eSet(int, Object)
M: 25 C: 17
40%
M: 3 C: 3
50%
M: 3 C: 3
50%
M: 8 C: 7
47%
M: 0 C: 1
100%
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%
getDelegates()
M: 14 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
getDisplayName()
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%
getLogin()
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%
getPassword()
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%
getSubUsers()
M: 14 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
setDisplayName(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%
setLogin(String)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 4
80%
M: 0 C: 1
100%
setPassword(String)
M: 11 C: 10
48%
M: 1 C: 1
50%
M: 1 C: 1
50%
M: 1 C: 4
80%
M: 0 C: 1
100%
static {...}
M: 0 C: 7
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
toString()
M: 46 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 11 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: * Christian W. Damus - bug 529138
14: */
15: package org.eclipse.emfforms.core.services.datatemplate.test.model.audit.impl;
16:
17: import java.util.Collection;
18:
19: import org.eclipse.emf.common.notify.Notification;
20: import org.eclipse.emf.common.util.EList;
21: import org.eclipse.emf.ecore.EClass;
22: import org.eclipse.emf.ecore.impl.ENotificationImpl;
23: import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
24: import org.eclipse.emf.ecore.util.EObjectResolvingEList;
25: import org.eclipse.emfforms.core.services.datatemplate.test.model.audit.AbstractSubUser;
26: import org.eclipse.emfforms.core.services.datatemplate.test.model.audit.AuditPackage;
27: import org.eclipse.emfforms.core.services.datatemplate.test.model.audit.RegisteredUser;
28: import org.eclipse.emfforms.core.services.datatemplate.test.model.audit.User;
29:
30: /**
31: * <!-- begin-user-doc -->
32: * An implementation of the model object '<em><b>User</b></em>'.
33: * <!-- end-user-doc -->
34: * <p>
35: * The following features are implemented:
36: * </p>
37: * <ul>
38: * <li>{@link org.eclipse.emfforms.core.services.datatemplate.test.model.audit.impl.UserImpl#getDisplayName <em>Display
39: * Name</em>}</li>
40: * <li>{@link org.eclipse.emfforms.core.services.datatemplate.test.model.audit.impl.UserImpl#getLogin
41: * <em>Login</em>}</li>
42: * <li>{@link org.eclipse.emfforms.core.services.datatemplate.test.model.audit.impl.UserImpl#getPassword
43: * <em>Password</em>}</li>
44: * <li>{@link org.eclipse.emfforms.core.services.datatemplate.test.model.audit.impl.UserImpl#getDelegates
45: * <em>Delegates</em>}</li>
46: * <li>{@link org.eclipse.emfforms.core.services.datatemplate.test.model.audit.impl.UserImpl#getSubUsers <em>Sub
47: * Users</em>}</li>
48: * </ul>
49: *
50: * @generated
51: */
52: public abstract class UserImpl extends MinimalEObjectImpl.Container implements User {
53:         /**
54:          * The default value of the '{@link #getDisplayName() <em>Display Name</em>}' attribute.
55:          * <!-- begin-user-doc -->
56:          * <!-- end-user-doc -->
57:          *
58:          * @see #getDisplayName()
59:          * @generated
60:          * @ordered
61:          */
62:         protected static final String DISPLAY_NAME_EDEFAULT = null;
63:
64:         /**
65:          * The cached value of the '{@link #getDisplayName() <em>Display Name</em>}' attribute.
66:          * <!-- begin-user-doc -->
67:          * <!-- end-user-doc -->
68:          *
69:          * @see #getDisplayName()
70:          * @generated
71:          * @ordered
72:          */
73:         protected String displayName = DISPLAY_NAME_EDEFAULT;
74:
75:         /**
76:          * The default value of the '{@link #getLogin() <em>Login</em>}' attribute.
77:          * <!-- begin-user-doc -->
78:          * <!-- end-user-doc -->
79:          *
80:          * @see #getLogin()
81:          * @generated
82:          * @ordered
83:          */
84:         protected static final String LOGIN_EDEFAULT = null;
85:
86:         /**
87:          * The cached value of the '{@link #getLogin() <em>Login</em>}' attribute.
88:          * <!-- begin-user-doc -->
89:          * <!-- end-user-doc -->
90:          *
91:          * @see #getLogin()
92:          * @generated
93:          * @ordered
94:          */
95:         protected String login = LOGIN_EDEFAULT;
96:
97:         /**
98:          * The default value of the '{@link #getPassword() <em>Password</em>}' attribute.
99:          * <!-- begin-user-doc -->
100:          * <!-- end-user-doc -->
101:          *
102:          * @see #getPassword()
103:          * @generated
104:          * @ordered
105:          */
106:         protected static final String PASSWORD_EDEFAULT = null;
107:
108:         /**
109:          * The cached value of the '{@link #getPassword() <em>Password</em>}' attribute.
110:          * <!-- begin-user-doc -->
111:          * <!-- end-user-doc -->
112:          *
113:          * @see #getPassword()
114:          * @generated
115:          * @ordered
116:          */
117:         protected String password = PASSWORD_EDEFAULT;
118:
119:         /**
120:          * The cached value of the '{@link #getDelegates() <em>Delegates</em>}' reference list.
121:          * <!-- begin-user-doc -->
122:          * <!-- end-user-doc -->
123:          *
124:          * @see #getDelegates()
125:          * @generated
126:          * @ordered
127:          */
128:         protected EList<RegisteredUser> delegates;
129:
130:         /**
131:          * The cached value of the '{@link #getSubUsers() <em>Sub Users</em>}' reference list.
132:          * <!-- begin-user-doc -->
133:          * <!-- end-user-doc -->
134:          *
135:          * @see #getSubUsers()
136:          * @generated
137:          * @ordered
138:          */
139:         protected EList<AbstractSubUser> subUsers;
140:
141:         /**
142:          * <!-- begin-user-doc -->
143:          * <!-- end-user-doc -->
144:          *
145:          * @generated
146:          */
147:         protected UserImpl() {
148:                 super();
149:         }
150:
151:         /**
152:          * <!-- begin-user-doc -->
153:          * <!-- end-user-doc -->
154:          *
155:          * @generated
156:          */
157:         @Override
158:         protected EClass eStaticClass() {
159:                 return AuditPackage.Literals.USER;
160:         }
161:
162:         /**
163:          * <!-- begin-user-doc -->
164:          * <!-- end-user-doc -->
165:          *
166:          * @generated
167:          */
168:         @Override
169:         public String getDisplayName() {
170:                 return displayName;
171:         }
172:
173:         /**
174:          * <!-- begin-user-doc -->
175:          * <!-- end-user-doc -->
176:          *
177:          * @generated
178:          */
179:         @Override
180:         public void setDisplayName(String newDisplayName) {
181:                 final String oldDisplayName = displayName;
182:                 displayName = newDisplayName;
183:•                if (eNotificationRequired()) {
184:                         eNotify(new ENotificationImpl(this, Notification.SET, AuditPackage.USER__DISPLAY_NAME, oldDisplayName,
185:                                 displayName));
186:                 }
187:         }
188:
189:         /**
190:          * <!-- begin-user-doc -->
191:          * <!-- end-user-doc -->
192:          *
193:          * @generated
194:          */
195:         @Override
196:         public String getLogin() {
197:                 return login;
198:         }
199:
200:         /**
201:          * <!-- begin-user-doc -->
202:          * <!-- end-user-doc -->
203:          *
204:          * @generated
205:          */
206:         @Override
207:         public void setLogin(String newLogin) {
208:                 final String oldLogin = login;
209:                 login = newLogin;
210:•                if (eNotificationRequired()) {
211:                         eNotify(new ENotificationImpl(this, Notification.SET, AuditPackage.USER__LOGIN, oldLogin, login));
212:                 }
213:         }
214:
215:         /**
216:          * <!-- begin-user-doc -->
217:          * <!-- end-user-doc -->
218:          *
219:          * @generated
220:          */
221:         @Override
222:         public String getPassword() {
223:                 return password;
224:         }
225:
226:         /**
227:          * <!-- begin-user-doc -->
228:          * <!-- end-user-doc -->
229:          *
230:          * @generated
231:          */
232:         @Override
233:         public void setPassword(String newPassword) {
234:                 final String oldPassword = password;
235:                 password = newPassword;
236:•                if (eNotificationRequired()) {
237:                         eNotify(new ENotificationImpl(this, Notification.SET, AuditPackage.USER__PASSWORD, oldPassword, password));
238:                 }
239:         }
240:
241:         /**
242:          * <!-- begin-user-doc -->
243:          * <!-- end-user-doc -->
244:          *
245:          * @generated
246:          */
247:         @Override
248:         public EList<RegisteredUser> getDelegates() {
249:•                if (delegates == null) {
250:                         delegates = new EObjectResolvingEList<RegisteredUser>(RegisteredUser.class, this,
251:                                 AuditPackage.USER__DELEGATES);
252:                 }
253:                 return delegates;
254:         }
255:
256:         /**
257:          * <!-- begin-user-doc -->
258:          * <!-- end-user-doc -->
259:          *
260:          * @generated
261:          */
262:         @Override
263:         public EList<AbstractSubUser> getSubUsers() {
264:•                if (subUsers == null) {
265:                         subUsers = new EObjectResolvingEList<AbstractSubUser>(AbstractSubUser.class, this,
266:                                 AuditPackage.USER__SUB_USERS);
267:                 }
268:                 return subUsers;
269:         }
270:
271:         /**
272:          * <!-- begin-user-doc -->
273:          * <!-- end-user-doc -->
274:          *
275:          * @generated
276:          */
277:         @Override
278:         public Object eGet(int featureID, boolean resolve, boolean coreType) {
279:•                switch (featureID) {
280:                 case AuditPackage.USER__DISPLAY_NAME:
281:                         return getDisplayName();
282:                 case AuditPackage.USER__LOGIN:
283:                         return getLogin();
284:                 case AuditPackage.USER__PASSWORD:
285:                         return getPassword();
286:                 case AuditPackage.USER__DELEGATES:
287:                         return getDelegates();
288:                 case AuditPackage.USER__SUB_USERS:
289:                         return getSubUsers();
290:                 }
291:                 return super.eGet(featureID, resolve, coreType);
292:         }
293:
294:         /**
295:          * <!-- begin-user-doc -->
296:          * <!-- end-user-doc -->
297:          *
298:          * @generated
299:          */
300:         @SuppressWarnings("unchecked")
301:         @Override
302:         public void eSet(int featureID, Object newValue) {
303:•                switch (featureID) {
304:                 case AuditPackage.USER__DISPLAY_NAME:
305:                         setDisplayName((String) newValue);
306:                         return;
307:                 case AuditPackage.USER__LOGIN:
308:                         setLogin((String) newValue);
309:                         return;
310:                 case AuditPackage.USER__PASSWORD:
311:                         setPassword((String) newValue);
312:                         return;
313:                 case AuditPackage.USER__DELEGATES:
314:                         getDelegates().clear();
315:                         getDelegates().addAll((Collection<? extends RegisteredUser>) newValue);
316:                         return;
317:                 case AuditPackage.USER__SUB_USERS:
318:                         getSubUsers().clear();
319:                         getSubUsers().addAll((Collection<? extends AbstractSubUser>) newValue);
320:                         return;
321:                 }
322:                 super.eSet(featureID, newValue);
323:         }
324:
325:         /**
326:          * <!-- begin-user-doc -->
327:          * <!-- end-user-doc -->
328:          *
329:          * @generated
330:          */
331:         @Override
332:         public void eUnset(int featureID) {
333:•                switch (featureID) {
334:                 case AuditPackage.USER__DISPLAY_NAME:
335:                         setDisplayName(DISPLAY_NAME_EDEFAULT);
336:                         return;
337:                 case AuditPackage.USER__LOGIN:
338:                         setLogin(LOGIN_EDEFAULT);
339:                         return;
340:                 case AuditPackage.USER__PASSWORD:
341:                         setPassword(PASSWORD_EDEFAULT);
342:                         return;
343:                 case AuditPackage.USER__DELEGATES:
344:                         getDelegates().clear();
345:                         return;
346:                 case AuditPackage.USER__SUB_USERS:
347:                         getSubUsers().clear();
348:                         return;
349:                 }
350:                 super.eUnset(featureID);
351:         }
352:
353:         /**
354:          * <!-- begin-user-doc -->
355:          * <!-- end-user-doc -->
356:          *
357:          * @generated
358:          */
359:         @Override
360:         public boolean eIsSet(int featureID) {
361:•                switch (featureID) {
362:                 case AuditPackage.USER__DISPLAY_NAME:
363:•                        return DISPLAY_NAME_EDEFAULT == null ? displayName != null : !DISPLAY_NAME_EDEFAULT.equals(displayName);
364:                 case AuditPackage.USER__LOGIN:
365:•                        return LOGIN_EDEFAULT == null ? login != null : !LOGIN_EDEFAULT.equals(login);
366:                 case AuditPackage.USER__PASSWORD:
367:•                        return PASSWORD_EDEFAULT == null ? password != null : !PASSWORD_EDEFAULT.equals(password);
368:                 case AuditPackage.USER__DELEGATES:
369:•                        return delegates != null && !delegates.isEmpty();
370:                 case AuditPackage.USER__SUB_USERS:
371:•                        return subUsers != null && !subUsers.isEmpty();
372:                 }
373:                 return super.eIsSet(featureID);
374:         }
375:
376:         /**
377:          * <!-- begin-user-doc -->
378:          * <!-- end-user-doc -->
379:          *
380:          * @generated
381:          */
382:         @Override
383:         public String toString() {
384:•                if (eIsProxy()) {
385:                         return super.toString();
386:                 }
387:
388:                 final StringBuffer result = new StringBuffer(super.toString());
389:                 result.append(" (displayName: "); //$NON-NLS-1$
390:                 result.append(displayName);
391:                 result.append(", login: "); //$NON-NLS-1$
392:                 result.append(login);
393:                 result.append(", password: "); //$NON-NLS-1$
394:                 result.append(password);
395:                 result.append(')');
396:                 return result.toString();
397:         }
398:
399: } // UserImpl