| /***************************************************************************** |
| * 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.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| |
| import org.eclipse.papyrus.aas.AASPackage; |
| import org.eclipse.papyrus.aas.AdministrativeInformation; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Administrative Information</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.aas.impl.AdministrativeInformationImpl#getVersion <em>Version</em>}</li> |
| * <li>{@link org.eclipse.papyrus.aas.impl.AdministrativeInformationImpl#getRevision <em>Revision</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class AdministrativeInformationImpl extends MinimalEObjectImpl.Container implements AdministrativeInformation { |
| /** |
| * The default value of the '{@link #getVersion() <em>Version</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getVersion() |
| * @generated |
| * @ordered |
| */ |
| protected static final String VERSION_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getVersion() <em>Version</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getVersion() |
| * @generated |
| * @ordered |
| */ |
| protected String version = VERSION_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getRevision() <em>Revision</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getRevision() |
| * @generated |
| * @ordered |
| */ |
| protected static final String REVISION_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getRevision() <em>Revision</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getRevision() |
| * @generated |
| * @ordered |
| */ |
| protected String revision = REVISION_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected AdministrativeInformationImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return AASPackage.Literals.ADMINISTRATIVE_INFORMATION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public String getVersion() { |
| return version; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void setVersion(String newVersion) { |
| String oldVersion = version; |
| version = newVersion; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AASPackage.ADMINISTRATIVE_INFORMATION__VERSION, oldVersion, version)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public String getRevision() { |
| return revision; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void setRevision(String newRevision) { |
| String oldRevision = revision; |
| revision = newRevision; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, AASPackage.ADMINISTRATIVE_INFORMATION__REVISION, oldRevision, revision)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case AASPackage.ADMINISTRATIVE_INFORMATION__VERSION: |
| return getVersion(); |
| case AASPackage.ADMINISTRATIVE_INFORMATION__REVISION: |
| return getRevision(); |
| } |
| 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.ADMINISTRATIVE_INFORMATION__VERSION: |
| setVersion((String) newValue); |
| return; |
| case AASPackage.ADMINISTRATIVE_INFORMATION__REVISION: |
| setRevision((String) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case AASPackage.ADMINISTRATIVE_INFORMATION__VERSION: |
| setVersion(VERSION_EDEFAULT); |
| return; |
| case AASPackage.ADMINISTRATIVE_INFORMATION__REVISION: |
| setRevision(REVISION_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case AASPackage.ADMINISTRATIVE_INFORMATION__VERSION: |
| return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version); |
| case AASPackage.ADMINISTRATIVE_INFORMATION__REVISION: |
| return REVISION_EDEFAULT == null ? revision != null : !REVISION_EDEFAULT.equals(revision); |
| } |
| 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(" (version: "); |
| result.append(version); |
| result.append(", revision: "); |
| result.append(revision); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } // AdministrativeInformationImpl |