blob: 5ff6dbb2dcbbe8916ce99f2bcd2e70e35b35eded [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.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.papyrus.pdp4eng.common.profile.pdp4engCommonGDPR.LegitimateInterest;
import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.LawfulByLegitimateInterest;
import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.pdp4engReqGDPRPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Lawful By Legitimate Interest</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.impl.LawfulByLegitimateInterestImpl#getLegitimateInterest <em>Legitimate Interest</em>}</li>
* </ul>
*
* @generated
*/
public class LawfulByLegitimateInterestImpl extends LawfulImpl implements LawfulByLegitimateInterest {
/**
* The cached value of the '{@link #getLegitimateInterest() <em>Legitimate Interest</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getLegitimateInterest()
* @generated
* @ordered
*/
protected LegitimateInterest legitimateInterest;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected LawfulByLegitimateInterestImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return pdp4engReqGDPRPackage.Literals.LAWFUL_BY_LEGITIMATE_INTEREST;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public LegitimateInterest getLegitimateInterest() {
if (legitimateInterest != null && legitimateInterest.eIsProxy()) {
InternalEObject oldLegitimateInterest = (InternalEObject)legitimateInterest;
legitimateInterest = (LegitimateInterest)eResolveProxy(oldLegitimateInterest);
if (legitimateInterest != oldLegitimateInterest) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, pdp4engReqGDPRPackage.LAWFUL_BY_LEGITIMATE_INTEREST__LEGITIMATE_INTEREST, oldLegitimateInterest, legitimateInterest));
}
}
return legitimateInterest;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public LegitimateInterest basicGetLegitimateInterest() {
return legitimateInterest;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setLegitimateInterest(LegitimateInterest newLegitimateInterest) {
LegitimateInterest oldLegitimateInterest = legitimateInterest;
legitimateInterest = newLegitimateInterest;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, pdp4engReqGDPRPackage.LAWFUL_BY_LEGITIMATE_INTEREST__LEGITIMATE_INTEREST, oldLegitimateInterest, legitimateInterest));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case pdp4engReqGDPRPackage.LAWFUL_BY_LEGITIMATE_INTEREST__LEGITIMATE_INTEREST:
if (resolve) return getLegitimateInterest();
return basicGetLegitimateInterest();
}
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.LAWFUL_BY_LEGITIMATE_INTEREST__LEGITIMATE_INTEREST:
setLegitimateInterest((LegitimateInterest)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case pdp4engReqGDPRPackage.LAWFUL_BY_LEGITIMATE_INTEREST__LEGITIMATE_INTEREST:
setLegitimateInterest((LegitimateInterest)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case pdp4engReqGDPRPackage.LAWFUL_BY_LEGITIMATE_INTEREST__LEGITIMATE_INTEREST:
return legitimateInterest != null;
}
return super.eIsSet(featureID);
}
} //LawfulByLegitimateInterestImpl