/** * Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others. * 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: * Eike Stepper - initial API and implementation */ package org.eclipse.emf.cdo.tests.legacy.model1.impl; import org.eclipse.emf.cdo.tests.legacy.model1.Model1Package; import org.eclipse.emf.cdo.tests.model1.Address; 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; /** * An implementation of the model object 'Address'. *

* The following features are implemented: *

*

* * @generated */ public class AddressImpl extends EObjectImpl implements Address { /** * * * @generated */ public static final String copyright = "Copyright (c) 2004 - 2010 Eike Stepper (Berlin, Germany) and others.\r\nAll rights reserved. This program and the accompanying materials\r\nare made available under the terms of the Eclipse Public License v1.0\r\nwhich accompanies this distribution, and is available at\r\nhttp://www.eclipse.org/legal/epl-v10.html\r\n\r\nContributors:\r\n Eike Stepper - initial API and implementation"; /** * The default value of the '{@link #getName() Name}' attribute. * * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() Name}' attribute. * * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * The default value of the '{@link #getStreet() Street}' attribute. * * @see #getStreet() * @generated * @ordered */ protected static final String STREET_EDEFAULT = null; /** * The cached value of the '{@link #getStreet() Street}' attribute. * * @see #getStreet() * @generated * @ordered */ protected String street = STREET_EDEFAULT; /** * The default value of the '{@link #getCity() City}' attribute. * * @see #getCity() * @generated * @ordered */ protected static final String CITY_EDEFAULT = null; /** * The cached value of the '{@link #getCity() City}' attribute. * * @see #getCity() * @generated * @ordered */ protected String city = CITY_EDEFAULT; /** * * * @generated */ protected AddressImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return Model1Package.Literals.ADDRESS; } /** * * * @generated */ public String getName() { return name; } /** * * * @generated */ public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, Model1Package.ADDRESS__NAME, oldName, name)); } } /** * * * @generated */ public String getStreet() { return street; } /** * * * @generated */ public void setStreet(String newStreet) { String oldStreet = street; street = newStreet; if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, Model1Package.ADDRESS__STREET, oldStreet, street)); } } /** * * * @generated */ public String getCity() { return city; } /** * * * @generated */ public void setCity(String newCity) { String oldCity = city; city = newCity; if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, Model1Package.ADDRESS__CITY, oldCity, city)); } } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case Model1Package.ADDRESS__NAME: return getName(); case Model1Package.ADDRESS__STREET: return getStreet(); case Model1Package.ADDRESS__CITY: return getCity(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case Model1Package.ADDRESS__NAME: setName((String)newValue); return; case Model1Package.ADDRESS__STREET: setStreet((String)newValue); return; case Model1Package.ADDRESS__CITY: setCity((String)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case Model1Package.ADDRESS__NAME: setName(NAME_EDEFAULT); return; case Model1Package.ADDRESS__STREET: setStreet(STREET_EDEFAULT); return; case Model1Package.ADDRESS__CITY: setCity(CITY_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case Model1Package.ADDRESS__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case Model1Package.ADDRESS__STREET: return STREET_EDEFAULT == null ? street != null : !STREET_EDEFAULT.equals(street); case Model1Package.ADDRESS__CITY: return CITY_EDEFAULT == null ? city != null : !CITY_EDEFAULT.equals(city); } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) { return super.toString(); } StringBuffer result = new StringBuffer(super.toString()); result.append(" (name: "); result.append(name); result.append(", street: "); result.append(street); result.append(", city: "); result.append(city); result.append(')'); return result.toString(); } } // AddressImpl