| /** |
| * 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.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.util.EObjectResolvingEList; |
| |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.DataUnlinkabilityRequirement; |
| import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.pdp4engReqGDPRPackage; |
| |
| import org.eclipse.uml2.uml.NamedElement; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Data Unlinkability Requirement</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.impl.DataUnlinkabilityRequirementImpl#getLinks <em>Links</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DataUnlinkabilityRequirementImpl extends UnlinkabilityRequirementImpl implements DataUnlinkabilityRequirement { |
| /** |
| * The cached value of the '{@link #getLinks() <em>Links</em>}' reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLinks() |
| * @generated |
| * @ordered |
| */ |
| protected EList<NamedElement> links; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DataUnlinkabilityRequirementImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return pdp4engReqGDPRPackage.Literals.DATA_UNLINKABILITY_REQUIREMENT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public EList<NamedElement> getLinks() { |
| if (links == null) { |
| links = new EObjectResolvingEList<NamedElement>(NamedElement.class, this, pdp4engReqGDPRPackage.DATA_UNLINKABILITY_REQUIREMENT__LINKS); |
| } |
| return links; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NamedElement getLinks(String name) { |
| return getLinks(name, false, null); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NamedElement getLinks(String name, boolean ignoreCase, EClass eClass) { |
| linksLoop: for (NamedElement links : getLinks()) { |
| if (eClass != null && !eClass.isInstance(links)) |
| continue linksLoop; |
| if (name != null && !(ignoreCase ? name.equalsIgnoreCase(links.getName()) : name.equals(links.getName()))) |
| continue linksLoop; |
| return links; |
| } |
| return null; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case pdp4engReqGDPRPackage.DATA_UNLINKABILITY_REQUIREMENT__LINKS: |
| return getLinks(); |
| } |
| 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_UNLINKABILITY_REQUIREMENT__LINKS: |
| getLinks().clear(); |
| getLinks().addAll((Collection<? extends NamedElement>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case pdp4engReqGDPRPackage.DATA_UNLINKABILITY_REQUIREMENT__LINKS: |
| getLinks().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case pdp4engReqGDPRPackage.DATA_UNLINKABILITY_REQUIREMENT__LINKS: |
| return links != null && !links.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //DataUnlinkabilityRequirementImpl |