org.nasdanika.models.architecture.impl.RoleImpl Maven / Gradle / Ivy
The newest version!
/**
*/
package org.nasdanika.models.architecture.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.Actor;
import org.nasdanika.models.architecture.ArchitecturePackage;
import org.nasdanika.models.architecture.Role;
import org.nasdanika.ncore.NcorePackage;
import org.nasdanika.ncore.StringIdentity;
/**
*
* An implementation of the model object 'Role'.
*
*
* The following features are implemented:
*
*
* - {@link org.nasdanika.models.architecture.impl.RoleImpl#getId Id}
* - {@link org.nasdanika.models.architecture.impl.RoleImpl#getActors Actors}
* - {@link org.nasdanika.models.architecture.impl.RoleImpl#getExtends Extends}
* - {@link org.nasdanika.models.architecture.impl.RoleImpl#getExtensions Extensions}
*
*
* @generated
*/
public class RoleImpl extends ArchitectureElementImpl implements Role {
/**
* The default value of the '{@link #getId() Id}' attribute.
*
*
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
*
*
* @generated
*/
protected RoleImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ArchitecturePackage.Literals.ROLE;
}
/**
*
*
* @generated
*/
@Override
public String getId() {
return (String)eDynamicGet(ArchitecturePackage.ROLE__ID, NcorePackage.Literals.STRING_IDENTITY__ID, true, true);
}
/**
*
*
* @generated
*/
@Override
public void setId(String newId) {
eDynamicSet(ArchitecturePackage.ROLE__ID, NcorePackage.Literals.STRING_IDENTITY__ID, newId);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public EList getActors() {
return (EList)eDynamicGet(ArchitecturePackage.ROLE__ACTORS, ArchitecturePackage.Literals.ROLE__ACTORS, true, true);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public EList getExtends() {
return (EList)eDynamicGet(ArchitecturePackage.ROLE__EXTENDS, ArchitecturePackage.Literals.ROLE__EXTENDS, true, true);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public EList getExtensions() {
return (EList)eDynamicGet(ArchitecturePackage.ROLE__EXTENSIONS, ArchitecturePackage.Literals.ROLE__EXTENSIONS, true, true);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ArchitecturePackage.ROLE__ACTORS:
return ((InternalEList)(InternalEList>)getActors()).basicAdd(otherEnd, msgs);
case ArchitecturePackage.ROLE__EXTENDS:
return ((InternalEList)(InternalEList>)getExtends()).basicAdd(otherEnd, msgs);
case ArchitecturePackage.ROLE__EXTENSIONS:
return ((InternalEList)(InternalEList>)getExtensions()).basicAdd(otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ArchitecturePackage.ROLE__ACTORS:
return ((InternalEList>)getActors()).basicRemove(otherEnd, msgs);
case ArchitecturePackage.ROLE__EXTENDS:
return ((InternalEList>)getExtends()).basicRemove(otherEnd, msgs);
case ArchitecturePackage.ROLE__EXTENSIONS:
return ((InternalEList>)getExtensions()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ArchitecturePackage.ROLE__ID:
return getId();
case ArchitecturePackage.ROLE__ACTORS:
return getActors();
case ArchitecturePackage.ROLE__EXTENDS:
return getExtends();
case ArchitecturePackage.ROLE__EXTENSIONS:
return getExtensions();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ArchitecturePackage.ROLE__ID:
setId((String)newValue);
return;
case ArchitecturePackage.ROLE__ACTORS:
getActors().clear();
getActors().addAll((Collection extends Actor>)newValue);
return;
case ArchitecturePackage.ROLE__EXTENDS:
getExtends().clear();
getExtends().addAll((Collection extends Role>)newValue);
return;
case ArchitecturePackage.ROLE__EXTENSIONS:
getExtensions().clear();
getExtensions().addAll((Collection extends Role>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ArchitecturePackage.ROLE__ID:
setId(ID_EDEFAULT);
return;
case ArchitecturePackage.ROLE__ACTORS:
getActors().clear();
return;
case ArchitecturePackage.ROLE__EXTENDS:
getExtends().clear();
return;
case ArchitecturePackage.ROLE__EXTENSIONS:
getExtensions().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ArchitecturePackage.ROLE__ID:
return ID_EDEFAULT == null ? getId() != null : !ID_EDEFAULT.equals(getId());
case ArchitecturePackage.ROLE__ACTORS:
return !getActors().isEmpty();
case ArchitecturePackage.ROLE__EXTENDS:
return !getExtends().isEmpty();
case ArchitecturePackage.ROLE__EXTENSIONS:
return !getExtensions().isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class> baseClass) {
if (baseClass == StringIdentity.class) {
switch (derivedFeatureID) {
case ArchitecturePackage.ROLE__ID: return NcorePackage.STRING_IDENTITY__ID;
default: return -1;
}
}
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
/**
*
*
* @generated
*/
@Override
public int eDerivedStructuralFeatureID(int baseFeatureID, Class> baseClass) {
if (baseClass == StringIdentity.class) {
switch (baseFeatureID) {
case NcorePackage.STRING_IDENTITY__ID: return ArchitecturePackage.ROLE__ID;
default: return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
} //RoleImpl