org.nasdanika.models.rules.impl.WaiverImpl Maven / Gradle / Ivy
/**
*/
package org.nasdanika.models.rules.impl;
import java.util.Collection;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.InternalEList;
import org.nasdanika.models.architecture.impl.ArchitectureDescriptionElementImpl;
import org.nasdanika.models.rules.RulesPackage;
import org.nasdanika.models.rules.Violation;
import org.nasdanika.models.rules.Waiver;
/**
*
* An implementation of the model object 'Waiver'.
*
*
* The following features are implemented:
*
*
* - {@link org.nasdanika.models.rules.impl.WaiverImpl#getViolations Violations}
*
*
* @generated
*/
public class WaiverImpl extends ArchitectureDescriptionElementImpl implements Waiver {
/**
*
*
* @generated
*/
protected WaiverImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return RulesPackage.Literals.WAIVER;
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public EList getViolations() {
return (EList)eDynamicGet(RulesPackage.WAIVER__VIOLATIONS, RulesPackage.Literals.WAIVER__VIOLATIONS, true, true);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case RulesPackage.WAIVER__VIOLATIONS:
return ((InternalEList)(InternalEList>)getViolations()).basicAdd(otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case RulesPackage.WAIVER__VIOLATIONS:
return ((InternalEList>)getViolations()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case RulesPackage.WAIVER__VIOLATIONS:
return getViolations();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case RulesPackage.WAIVER__VIOLATIONS:
getViolations().clear();
getViolations().addAll((Collection extends Violation>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RulesPackage.WAIVER__VIOLATIONS:
getViolations().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RulesPackage.WAIVER__VIOLATIONS:
return !getViolations().isEmpty();
}
return super.eIsSet(featureID);
}
} //WaiverImpl