blob: 8d500006952a234f0f8ad2334cf625e736d81af5 [file] [log] [blame]
/**
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* 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:
* Florian Pirchner - Initial implementation
*/
package org.eclipse.osbp.ecview.core.databinding.tests.emf.model.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
import org.eclipse.osbp.ecview.core.databinding.tests.emf.model.TCountry;
import org.eclipse.osbp.ecview.core.databinding.tests.emf.model.TestmodelPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>TCountry</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.osbp.ecview.core.databinding.tests.emf.model.impl.TCountryImpl#getIsoCode <em>Iso Code</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.core.databinding.tests.emf.model.impl.TCountryImpl#getCities <em>Cities</em>}</li>
* </ul>
*
*
* @generated
*/
public class TCountryImpl extends MinimalEObjectImpl.Container implements TCountry {
/**
* The default value of the '{@link #getIsoCode() <em>Iso Code</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIsoCode()
* @generated
* @ordered
*/
protected static final String ISO_CODE_EDEFAULT = null;
/**
* The cached value of the '{@link #getIsoCode() <em>Iso Code</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIsoCode()
* @generated
* @ordered
*/
protected String isoCode = ISO_CODE_EDEFAULT;
/**
* The cached value of the '{@link #getCities() <em>Cities</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCities()
* @generated
* @ordered
*/
protected EList<String> cities;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TCountryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return TestmodelPackage.Literals.TCOUNTRY;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getIsoCode() {
return isoCode;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIsoCode(String newIsoCode) {
String oldIsoCode = isoCode;
isoCode = newIsoCode;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, TestmodelPackage.TCOUNTRY__ISO_CODE, oldIsoCode, isoCode));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<String> getCities() {
if (cities == null) {
cities = new EDataTypeUniqueEList<String>(String.class, this, TestmodelPackage.TCOUNTRY__CITIES);
}
return cities;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case TestmodelPackage.TCOUNTRY__ISO_CODE:
return getIsoCode();
case TestmodelPackage.TCOUNTRY__CITIES:
return getCities();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case TestmodelPackage.TCOUNTRY__ISO_CODE:
setIsoCode((String)newValue);
return;
case TestmodelPackage.TCOUNTRY__CITIES:
getCities().clear();
getCities().addAll((Collection<? extends String>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case TestmodelPackage.TCOUNTRY__ISO_CODE:
setIsoCode(ISO_CODE_EDEFAULT);
return;
case TestmodelPackage.TCOUNTRY__CITIES:
getCities().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case TestmodelPackage.TCOUNTRY__ISO_CODE:
return ISO_CODE_EDEFAULT == null ? isoCode != null : !ISO_CODE_EDEFAULT.equals(isoCode);
case TestmodelPackage.TCOUNTRY__CITIES:
return cities != null && !cities.isEmpty();
}
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(" (isoCode: ");
result.append(isoCode);
result.append(", cities: ");
result.append(cities);
result.append(')');
return result.toString();
}
} //TCountryImpl