| /** |
| * ******************************************************************************* |
| * Copyright (c) 2015-2021 Robert Bosch GmbH and others. |
| * |
| * This program and the accompanying materials are made |
| * available under the terms of the Eclipse Public License 2.0 |
| * which is available at https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Generated using Eclipse EMF |
| * |
| * ******************************************************************************* |
| */ |
| package org.eclipse.app4mc.amalthea.model.impl; |
| |
| import org.eclipse.app4mc.amalthea.model.AmaltheaPackage; |
| import org.eclipse.app4mc.amalthea.model.CustomEntity; |
| import org.eclipse.app4mc.amalthea.model.IDescription; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Custom Entity</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.CustomEntityImpl#getDescription <em>Description</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.CustomEntityImpl#getTypeName <em>Type Name</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class CustomEntityImpl extends AbstractMemoryElementImpl implements CustomEntity { |
| /** |
| * The default value of the '{@link #getDescription() <em>Description</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDescription() |
| * @generated |
| * @ordered |
| */ |
| protected static final String DESCRIPTION_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDescription() |
| * @generated |
| * @ordered |
| */ |
| protected String description = DESCRIPTION_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getTypeName() <em>Type Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTypeName() |
| * @generated |
| * @ordered |
| */ |
| protected static final String TYPE_NAME_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getTypeName() <em>Type Name</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTypeName() |
| * @generated |
| * @ordered |
| */ |
| protected String typeName = TYPE_NAME_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected CustomEntityImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AmaltheaPackage.eINSTANCE.getCustomEntity(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getDescription() { |
| return description; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setDescription(String newDescription) { |
| String oldDescription = description; |
| description = newDescription; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.CUSTOM_ENTITY__DESCRIPTION, oldDescription, description)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getTypeName() { |
| return typeName; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setTypeName(String newTypeName) { |
| String oldTypeName = typeName; |
| typeName = newTypeName; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.CUSTOM_ENTITY__TYPE_NAME, oldTypeName, typeName)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case AmaltheaPackage.CUSTOM_ENTITY__DESCRIPTION: |
| return getDescription(); |
| case AmaltheaPackage.CUSTOM_ENTITY__TYPE_NAME: |
| return getTypeName(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case AmaltheaPackage.CUSTOM_ENTITY__DESCRIPTION: |
| setDescription((String)newValue); |
| return; |
| case AmaltheaPackage.CUSTOM_ENTITY__TYPE_NAME: |
| setTypeName((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.CUSTOM_ENTITY__DESCRIPTION: |
| setDescription(DESCRIPTION_EDEFAULT); |
| return; |
| case AmaltheaPackage.CUSTOM_ENTITY__TYPE_NAME: |
| setTypeName(TYPE_NAME_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.CUSTOM_ENTITY__DESCRIPTION: |
| return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); |
| case AmaltheaPackage.CUSTOM_ENTITY__TYPE_NAME: |
| return TYPE_NAME_EDEFAULT == null ? typeName != null : !TYPE_NAME_EDEFAULT.equals(typeName); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
| if (baseClass == IDescription.class) { |
| switch (derivedFeatureID) { |
| case AmaltheaPackage.CUSTOM_ENTITY__DESCRIPTION: return AmaltheaPackage.IDESCRIPTION__DESCRIPTION; |
| default: return -1; |
| } |
| } |
| return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { |
| if (baseClass == IDescription.class) { |
| switch (baseFeatureID) { |
| case AmaltheaPackage.IDESCRIPTION__DESCRIPTION: return AmaltheaPackage.CUSTOM_ENTITY__DESCRIPTION; |
| default: return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (description: "); |
| result.append(description); |
| result.append(", typeName: "); |
| result.append(typeName); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //CustomEntityImpl |