/******************************************************************************* * Copyright (c) 2008 Olivier Moises * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Olivier Moises- initial API and implementation *******************************************************************************/ package org.eclipse.wazaabi.engine.edp.tests.model.company.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; import org.eclipse.wazaabi.engine.edp.tests.model.company.CompanyPackage; import org.eclipse.wazaabi.engine.edp.tests.model.company.Employee; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Employee</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.wazaabi.engine.edp.tests.model.company.impl.EmployeeImpl#getFirstName <em>First Name</em>}</li> * <li>{@link org.eclipse.wazaabi.engine.edp.tests.model.company.impl.EmployeeImpl#getLastName <em>Last Name</em>}</li> * <li>{@link org.eclipse.wazaabi.engine.edp.tests.model.company.impl.EmployeeImpl#getAge <em>Age</em>}</li> * </ul> * </p> * * @generated */ public class EmployeeImpl extends EObjectImpl implements Employee { /** * The default value of the '{@link #getFirstName() <em>First Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFirstName() * @generated * @ordered */ protected static final String FIRST_NAME_EDEFAULT = null; /** * The cached value of the '{@link #getFirstName() <em>First Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getFirstName() * @generated * @ordered */ protected String firstName = FIRST_NAME_EDEFAULT; /** * The default value of the '{@link #getLastName() <em>Last Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLastName() * @generated * @ordered */ protected static final String LAST_NAME_EDEFAULT = null; /** * The cached value of the '{@link #getLastName() <em>Last Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLastName() * @generated * @ordered */ protected String lastName = LAST_NAME_EDEFAULT; /** * The default value of the '{@link #getAge() <em>Age</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAge() * @generated * @ordered */ protected static final int AGE_EDEFAULT = 0; /** * The cached value of the '{@link #getAge() <em>Age</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAge() * @generated * @ordered */ protected int age = AGE_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected EmployeeImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return CompanyPackage.Literals.EMPLOYEE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getFirstName() { return firstName; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setFirstName(String newFirstName) { String oldFirstName = firstName; firstName = newFirstName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackage.EMPLOYEE__FIRST_NAME, oldFirstName, firstName)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getLastName() { return lastName; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setLastName(String newLastName) { String oldLastName = lastName; lastName = newLastName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackage.EMPLOYEE__LAST_NAME, oldLastName, lastName)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public int getAge() { return age; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setAge(int newAge) { int oldAge = age; age = newAge; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CompanyPackage.EMPLOYEE__AGE, oldAge, age)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case CompanyPackage.EMPLOYEE__FIRST_NAME: return getFirstName(); case CompanyPackage.EMPLOYEE__LAST_NAME: return getLastName(); case CompanyPackage.EMPLOYEE__AGE: return getAge(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case CompanyPackage.EMPLOYEE__FIRST_NAME: setFirstName((String)newValue); return; case CompanyPackage.EMPLOYEE__LAST_NAME: setLastName((String)newValue); return; case CompanyPackage.EMPLOYEE__AGE: setAge((Integer)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case CompanyPackage.EMPLOYEE__FIRST_NAME: setFirstName(FIRST_NAME_EDEFAULT); return; case CompanyPackage.EMPLOYEE__LAST_NAME: setLastName(LAST_NAME_EDEFAULT); return; case CompanyPackage.EMPLOYEE__AGE: setAge(AGE_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case CompanyPackage.EMPLOYEE__FIRST_NAME: return FIRST_NAME_EDEFAULT == null ? firstName != null : !FIRST_NAME_EDEFAULT.equals(firstName); case CompanyPackage.EMPLOYEE__LAST_NAME: return LAST_NAME_EDEFAULT == null ? lastName != null : !LAST_NAME_EDEFAULT.equals(lastName); case CompanyPackage.EMPLOYEE__AGE: return age != AGE_EDEFAULT; } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (firstName: "); result.append(firstName); result.append(", lastName: "); result.append(lastName); result.append(", age: "); result.append(age); result.append(')'); return result.toString(); } } //EmployeeImpl