| /** |
| * Copyright (c)2020 CEA LIST, Committer Name, and others. |
| * |
| * 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: |
| * CEA LIST - Initial API and implementation |
| * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr |
| * Gabriel Pedroza (CEA LIST) gabriel.pedroza@cea.fr |
| * |
| */ |
| package org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.papyrus.pdp4eng.common.profile.pdp4engCommonGDPR.PersonalData; |
| import org.eclipse.papyrus.pdp4eng.common.profile.pdp4engCommonGDPR.Purpose; |
| |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.PurposePersonalDataPrinciple; |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.pdp4engReqGDPRPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Purpose Personal Data Principle</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.impl.PurposePersonalDataPrincipleImpl#getPurpose <em>Purpose</em>}</li> |
| * <li>{@link org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.impl.PurposePersonalDataPrincipleImpl#getPersonalData <em>Personal Data</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class PurposePersonalDataPrincipleImpl extends GDPRPrincipleImpl implements PurposePersonalDataPrinciple { |
| /** |
| * The cached value of the '{@link #getPurpose() <em>Purpose</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPurpose() |
| * @generated |
| * @ordered |
| */ |
| protected Purpose purpose; |
| |
| /** |
| * The cached value of the '{@link #getPersonalData() <em>Personal Data</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPersonalData() |
| * @generated |
| * @ordered |
| */ |
| protected PersonalData personalData; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PurposePersonalDataPrincipleImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return pdp4engReqGDPRPackage.Literals.PURPOSE_PERSONAL_DATA_PRINCIPLE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Purpose getPurpose() { |
| if (purpose != null && purpose.eIsProxy()) { |
| InternalEObject oldPurpose = (InternalEObject)purpose; |
| purpose = (Purpose)eResolveProxy(oldPurpose); |
| if (purpose != oldPurpose) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, pdp4engReqGDPRPackage.PURPOSE_PERSONAL_DATA_PRINCIPLE__PURPOSE, oldPurpose, purpose)); |
| } |
| } |
| return purpose; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Purpose basicGetPurpose() { |
| return purpose; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setPurpose(Purpose newPurpose) { |
| Purpose oldPurpose = purpose; |
| purpose = newPurpose; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, pdp4engReqGDPRPackage.PURPOSE_PERSONAL_DATA_PRINCIPLE__PURPOSE, oldPurpose, purpose)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public PersonalData getPersonalData() { |
| if (personalData != null && personalData.eIsProxy()) { |
| InternalEObject oldPersonalData = (InternalEObject)personalData; |
| personalData = (PersonalData)eResolveProxy(oldPersonalData); |
| if (personalData != oldPersonalData) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, pdp4engReqGDPRPackage.PURPOSE_PERSONAL_DATA_PRINCIPLE__PERSONAL_DATA, oldPersonalData, personalData)); |
| } |
| } |
| return personalData; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public PersonalData basicGetPersonalData() { |
| return personalData; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setPersonalData(PersonalData newPersonalData) { |
| PersonalData oldPersonalData = personalData; |
| personalData = newPersonalData; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, pdp4engReqGDPRPackage.PURPOSE_PERSONAL_DATA_PRINCIPLE__PERSONAL_DATA, oldPersonalData, personalData)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case pdp4engReqGDPRPackage.PURPOSE_PERSONAL_DATA_PRINCIPLE__PURPOSE: |
| if (resolve) return getPurpose(); |
| return basicGetPurpose(); |
| case pdp4engReqGDPRPackage.PURPOSE_PERSONAL_DATA_PRINCIPLE__PERSONAL_DATA: |
| if (resolve) return getPersonalData(); |
| return basicGetPersonalData(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case pdp4engReqGDPRPackage.PURPOSE_PERSONAL_DATA_PRINCIPLE__PURPOSE: |
| setPurpose((Purpose)newValue); |
| return; |
| case pdp4engReqGDPRPackage.PURPOSE_PERSONAL_DATA_PRINCIPLE__PERSONAL_DATA: |
| setPersonalData((PersonalData)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case pdp4engReqGDPRPackage.PURPOSE_PERSONAL_DATA_PRINCIPLE__PURPOSE: |
| setPurpose((Purpose)null); |
| return; |
| case pdp4engReqGDPRPackage.PURPOSE_PERSONAL_DATA_PRINCIPLE__PERSONAL_DATA: |
| setPersonalData((PersonalData)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case pdp4engReqGDPRPackage.PURPOSE_PERSONAL_DATA_PRINCIPLE__PURPOSE: |
| return purpose != null; |
| case pdp4engReqGDPRPackage.PURPOSE_PERSONAL_DATA_PRINCIPLE__PERSONAL_DATA: |
| return personalData != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //PurposePersonalDataPrincipleImpl |