blob: 14ad81aa6cd9ebc5fe454fb6fca2439fd1a2904e [file] [log] [blame]
/**
* 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.impl.ENotificationImpl;
import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.Linkability;
import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.UnlinkabilityRequirement;
import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.pdp4engReqGDPRPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>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.UnlinkabilityRequirementImpl#getLinkability <em>Linkability</em>}</li>
* </ul>
*
* @generated
*/
public class UnlinkabilityRequirementImpl extends PrivacyRequirementImpl implements UnlinkabilityRequirement {
/**
* The default value of the '{@link #getLinkability() <em>Linkability</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLinkability()
* @generated
* @ordered
*/
protected static final Linkability LINKABILITY_EDEFAULT = Linkability.SINGLE;
/**
* The cached value of the '{@link #getLinkability() <em>Linkability</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLinkability()
* @generated
* @ordered
*/
protected Linkability linkability = LINKABILITY_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected UnlinkabilityRequirementImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return pdp4engReqGDPRPackage.Literals.UNLINKABILITY_REQUIREMENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Linkability getLinkability() {
return linkability;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setLinkability(Linkability newLinkability) {
Linkability oldLinkability = linkability;
linkability = newLinkability == null ? LINKABILITY_EDEFAULT : newLinkability;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, pdp4engReqGDPRPackage.UNLINKABILITY_REQUIREMENT__LINKABILITY, oldLinkability, linkability));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case pdp4engReqGDPRPackage.UNLINKABILITY_REQUIREMENT__LINKABILITY:
return getLinkability();
}
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.UNLINKABILITY_REQUIREMENT__LINKABILITY:
setLinkability((Linkability)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case pdp4engReqGDPRPackage.UNLINKABILITY_REQUIREMENT__LINKABILITY:
setLinkability(LINKABILITY_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case pdp4engReqGDPRPackage.UNLINKABILITY_REQUIREMENT__LINKABILITY:
return linkability != LINKABILITY_EDEFAULT;
}
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(" (linkability: ");
result.append(linkability);
result.append(')');
return result.toString();
}
} //UnlinkabilityRequirementImpl