| /** |
| * ******************************************************************************* |
| * 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.Alias; |
| import org.eclipse.app4mc.amalthea.model.AmaltheaPackage; |
| |
| 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>Alias</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.AliasImpl#getTarget <em>Target</em>}</li> |
| * <li>{@link org.eclipse.app4mc.amalthea.model.impl.AliasImpl#getAlias <em>Alias</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class AliasImpl extends BaseObjectImpl implements Alias { |
| /** |
| * The default value of the '{@link #getTarget() <em>Target</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTarget() |
| * @generated |
| * @ordered |
| */ |
| protected static final String TARGET_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getTarget() <em>Target</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTarget() |
| * @generated |
| * @ordered |
| */ |
| protected String target = TARGET_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getAlias() <em>Alias</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAlias() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ALIAS_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getAlias() <em>Alias</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAlias() |
| * @generated |
| * @ordered |
| */ |
| protected String alias = ALIAS_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected AliasImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AmaltheaPackage.eINSTANCE.getAlias(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getTarget() { |
| return target; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setTarget(String newTarget) { |
| String oldTarget = target; |
| target = newTarget; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.ALIAS__TARGET, oldTarget, target)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String getAlias() { |
| return alias; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setAlias(String newAlias) { |
| String oldAlias = alias; |
| alias = newAlias; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.ALIAS__ALIAS, oldAlias, alias)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case AmaltheaPackage.ALIAS__TARGET: |
| return getTarget(); |
| case AmaltheaPackage.ALIAS__ALIAS: |
| return getAlias(); |
| } |
| 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.ALIAS__TARGET: |
| setTarget((String)newValue); |
| return; |
| case AmaltheaPackage.ALIAS__ALIAS: |
| setAlias((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.ALIAS__TARGET: |
| setTarget(TARGET_EDEFAULT); |
| return; |
| case AmaltheaPackage.ALIAS__ALIAS: |
| setAlias(ALIAS_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AmaltheaPackage.ALIAS__TARGET: |
| return TARGET_EDEFAULT == null ? target != null : !TARGET_EDEFAULT.equals(target); |
| case AmaltheaPackage.ALIAS__ALIAS: |
| return ALIAS_EDEFAULT == null ? alias != null : !ALIAS_EDEFAULT.equals(alias); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuilder result = new StringBuilder(super.toString()); |
| result.append(" (target: "); |
| result.append(target); |
| result.append(", alias: "); |
| result.append(alias); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //AliasImpl |