| /***************************************************************************** |
| * Copyright (c) 2020 CEA LIST. |
| * |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Saadia Dhouib (CEA LIST) saadia.dhouib@cea.fr - Initial API and implementation |
| * |
| *****************************************************************************/ |
| package org.eclipse.papyrus.aas.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.papyrus.aas.AASPackage; |
| import org.eclipse.papyrus.aas.AdministrativeInformation; |
| import org.eclipse.papyrus.aas.Identifiable; |
| import org.eclipse.papyrus.aas.Identifier; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Identifiable</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.aas.impl.IdentifiableImpl#getAdministration <em>Administration</em>}</li> |
| * <li>{@link org.eclipse.papyrus.aas.impl.IdentifiableImpl#getIdentification <em>Identification</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public abstract class IdentifiableImpl extends RefereableImpl implements Identifiable { |
| /** |
| * The cached value of the '{@link #getAdministration() <em>Administration</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getAdministration() |
| * @generated |
| * @ordered |
| */ |
| protected AdministrativeInformation administration; |
| |
| /** |
| * The cached value of the '{@link #getIdentification() <em>Identification</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getIdentification() |
| * @generated |
| * @ordered |
| */ |
| protected Identifier identification; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected IdentifiableImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AASPackage.Literals.IDENTIFIABLE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public AdministrativeInformation getAdministration() { |
| return administration; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public NotificationChain basicSetAdministration(AdministrativeInformation newAdministration, NotificationChain msgs) { |
| AdministrativeInformation oldAdministration = administration; |
| administration = newAdministration; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AASPackage.IDENTIFIABLE__ADMINISTRATION, oldAdministration, newAdministration); |
| if (msgs == null) |
| msgs = notification; |
| else |
| msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void setAdministration(AdministrativeInformation newAdministration) { |
| if (newAdministration != administration) { |
| NotificationChain msgs = null; |
| if (administration != null) |
| msgs = ((InternalEObject) administration).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AASPackage.IDENTIFIABLE__ADMINISTRATION, null, msgs); |
| if (newAdministration != null) |
| msgs = ((InternalEObject) newAdministration).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AASPackage.IDENTIFIABLE__ADMINISTRATION, null, msgs); |
| msgs = basicSetAdministration(newAdministration, msgs); |
| if (msgs != null) |
| msgs.dispatch(); |
| } else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AASPackage.IDENTIFIABLE__ADMINISTRATION, newAdministration, newAdministration)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public Identifier getIdentification() { |
| return identification; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public NotificationChain basicSetIdentification(Identifier newIdentification, NotificationChain msgs) { |
| Identifier oldIdentification = identification; |
| identification = newIdentification; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AASPackage.IDENTIFIABLE__IDENTIFICATION, oldIdentification, newIdentification); |
| if (msgs == null) |
| msgs = notification; |
| else |
| msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void setIdentification(Identifier newIdentification) { |
| if (newIdentification != identification) { |
| NotificationChain msgs = null; |
| if (identification != null) |
| msgs = ((InternalEObject) identification).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - AASPackage.IDENTIFIABLE__IDENTIFICATION, null, msgs); |
| if (newIdentification != null) |
| msgs = ((InternalEObject) newIdentification).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - AASPackage.IDENTIFIABLE__IDENTIFICATION, null, msgs); |
| msgs = basicSetIdentification(newIdentification, msgs); |
| if (msgs != null) |
| msgs.dispatch(); |
| } else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AASPackage.IDENTIFIABLE__IDENTIFICATION, newIdentification, newIdentification)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case AASPackage.IDENTIFIABLE__ADMINISTRATION: |
| return basicSetAdministration(null, msgs); |
| case AASPackage.IDENTIFIABLE__IDENTIFICATION: |
| return basicSetIdentification(null, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case AASPackage.IDENTIFIABLE__ADMINISTRATION: |
| return getAdministration(); |
| case AASPackage.IDENTIFIABLE__IDENTIFICATION: |
| return getIdentification(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case AASPackage.IDENTIFIABLE__ADMINISTRATION: |
| setAdministration((AdministrativeInformation) newValue); |
| return; |
| case AASPackage.IDENTIFIABLE__IDENTIFICATION: |
| setIdentification((Identifier) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AASPackage.IDENTIFIABLE__ADMINISTRATION: |
| setAdministration((AdministrativeInformation) null); |
| return; |
| case AASPackage.IDENTIFIABLE__IDENTIFICATION: |
| setIdentification((Identifier) null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AASPackage.IDENTIFIABLE__ADMINISTRATION: |
| return administration != null; |
| case AASPackage.IDENTIFIABLE__IDENTIFICATION: |
| return identification != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } // IdentifiableImpl |