| /** |
| * 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 java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| |
| import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| |
| import org.eclipse.papyrus.pdp4eng.common.profile.pdp4engCommonGDPR.Data; |
| |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.DataRecordRequirement; |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.pdp4engReqGDPRPackage; |
| |
| import org.eclipse.uml2.uml.DataStoreNode; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Data Record Requirement</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.impl.DataRecordRequirementImpl#getBase_DataStoreNode <em>Base Data Store Node</em>}</li> |
| * <li>{@link org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.impl.DataRecordRequirementImpl#getDataList <em>Data List</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DataRecordRequirementImpl extends MinimalEObjectImpl.Container implements DataRecordRequirement { |
| /** |
| * The cached value of the '{@link #getBase_DataStoreNode() <em>Base Data Store Node</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBase_DataStoreNode() |
| * @generated |
| * @ordered |
| */ |
| protected DataStoreNode base_DataStoreNode; |
| |
| /** |
| * The cached value of the '{@link #getDataList() <em>Data List</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDataList() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Data> dataList; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DataRecordRequirementImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return pdp4engReqGDPRPackage.Literals.DATA_RECORD_REQUIREMENT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public DataStoreNode getBase_DataStoreNode() { |
| if (base_DataStoreNode != null && base_DataStoreNode.eIsProxy()) { |
| InternalEObject oldBase_DataStoreNode = (InternalEObject)base_DataStoreNode; |
| base_DataStoreNode = (DataStoreNode)eResolveProxy(oldBase_DataStoreNode); |
| if (base_DataStoreNode != oldBase_DataStoreNode) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, pdp4engReqGDPRPackage.DATA_RECORD_REQUIREMENT__BASE_DATA_STORE_NODE, oldBase_DataStoreNode, base_DataStoreNode)); |
| } |
| } |
| return base_DataStoreNode; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DataStoreNode basicGetBase_DataStoreNode() { |
| return base_DataStoreNode; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void setBase_DataStoreNode(DataStoreNode newBase_DataStoreNode) { |
| DataStoreNode oldBase_DataStoreNode = base_DataStoreNode; |
| base_DataStoreNode = newBase_DataStoreNode; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, pdp4engReqGDPRPackage.DATA_RECORD_REQUIREMENT__BASE_DATA_STORE_NODE, oldBase_DataStoreNode, base_DataStoreNode)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EList<Data> getDataList() { |
| if (dataList == null) { |
| dataList = new EObjectResolvingEList<Data>(Data.class, this, pdp4engReqGDPRPackage.DATA_RECORD_REQUIREMENT__DATA_LIST); |
| } |
| return dataList; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case pdp4engReqGDPRPackage.DATA_RECORD_REQUIREMENT__BASE_DATA_STORE_NODE: |
| if (resolve) return getBase_DataStoreNode(); |
| return basicGetBase_DataStoreNode(); |
| case pdp4engReqGDPRPackage.DATA_RECORD_REQUIREMENT__DATA_LIST: |
| return getDataList(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case pdp4engReqGDPRPackage.DATA_RECORD_REQUIREMENT__BASE_DATA_STORE_NODE: |
| setBase_DataStoreNode((DataStoreNode)newValue); |
| return; |
| case pdp4engReqGDPRPackage.DATA_RECORD_REQUIREMENT__DATA_LIST: |
| getDataList().clear(); |
| getDataList().addAll((Collection<? extends Data>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case pdp4engReqGDPRPackage.DATA_RECORD_REQUIREMENT__BASE_DATA_STORE_NODE: |
| setBase_DataStoreNode((DataStoreNode)null); |
| return; |
| case pdp4engReqGDPRPackage.DATA_RECORD_REQUIREMENT__DATA_LIST: |
| getDataList().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case pdp4engReqGDPRPackage.DATA_RECORD_REQUIREMENT__BASE_DATA_STORE_NODE: |
| return base_DataStoreNode != null; |
| case pdp4engReqGDPRPackage.DATA_RECORD_REQUIREMENT__DATA_LIST: |
| return dataList != null && !dataList.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //DataRecordRequirementImpl |