blob: 270b6b738436e9947394ff7a9b7780156f8ea885 [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.Consent;
import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.LawfulByConsent;
import org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.pdp4engReqGDPRPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Lawful By Consent</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.pdp4eng.req.profile.pdp4engReqGDPR.impl.LawfulByConsentImpl#getConsent <em>Consent</em>}</li>
* </ul>
*
* @generated
*/
public class LawfulByConsentImpl extends LawfulImpl implements LawfulByConsent {
/**
* The cached value of the '{@link #getConsent() <em>Consent</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getConsent()
* @generated
* @ordered
*/
protected Consent consent;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected LawfulByConsentImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return pdp4engReqGDPRPackage.Literals.LAWFUL_BY_CONSENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Consent getConsent() {
if (consent != null && consent.eIsProxy()) {
InternalEObject oldConsent = (InternalEObject)consent;
consent = (Consent)eResolveProxy(oldConsent);
if (consent != oldConsent) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, pdp4engReqGDPRPackage.LAWFUL_BY_CONSENT__CONSENT, oldConsent, consent));
}
}
return consent;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Consent basicGetConsent() {
return consent;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setConsent(Consent newConsent) {
Consent oldConsent = consent;
consent = newConsent;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, pdp4engReqGDPRPackage.LAWFUL_BY_CONSENT__CONSENT, oldConsent, consent));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case pdp4engReqGDPRPackage.LAWFUL_BY_CONSENT__CONSENT:
if (resolve) return getConsent();
return basicGetConsent();
}
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_CONSENT__CONSENT:
setConsent((Consent)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_CONSENT__CONSENT:
setConsent((Consent)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case pdp4engReqGDPRPackage.LAWFUL_BY_CONSENT__CONSENT:
return consent != null;
}
return super.eIsSet(featureID);
}
} //LawfulByConsentImpl