org.nasdanika.models.architecture.impl.ActorImpl 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 'Actor'.
*
*
* The following features are implemented:
*
*
* - {@link org.nasdanika.models.architecture.impl.ActorImpl#getId Id}
* - {@link org.nasdanika.models.architecture.impl.ActorImpl#getRoles Roles}
*
*
* @generated
*/
public class ActorImpl extends ArchitectureElementImpl implements Actor {
/**
* The default value of the '{@link #getId() Id}' attribute.
*
*
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
*
*
* @generated
*/
protected ActorImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ArchitecturePackage.Literals.ACTOR;
}
/**
*
*
* @generated
*/
@Override
public String getId() {
return (String)eDynamicGet(ArchitecturePackage.ACTOR__ID, NcorePackage.Literals.STRING_IDENTITY__ID, true, true);
}
/**
*
*
* @generated
*/
@Override
public void setId(String newId) {
eDynamicSet(ArchitecturePackage.ACTOR__ID, NcorePackage.Literals.STRING_IDENTITY__ID, newId);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public EList getRoles() {
return (EList)eDynamicGet(ArchitecturePackage.ACTOR__ROLES, ArchitecturePackage.Literals.ACTOR__ROLES, true, true);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ArchitecturePackage.ACTOR__ROLES:
return ((InternalEList)(InternalEList>)getRoles()).basicAdd(otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ArchitecturePackage.ACTOR__ROLES:
return ((InternalEList>)getRoles()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ArchitecturePackage.ACTOR__ID:
return getId();
case ArchitecturePackage.ACTOR__ROLES:
return getRoles();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ArchitecturePackage.ACTOR__ID:
setId((String)newValue);
return;
case ArchitecturePackage.ACTOR__ROLES:
getRoles().clear();
getRoles().addAll((Collection extends Role>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ArchitecturePackage.ACTOR__ID:
setId(ID_EDEFAULT);
return;
case ArchitecturePackage.ACTOR__ROLES:
getRoles().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ArchitecturePackage.ACTOR__ID:
return ID_EDEFAULT == null ? getId() != null : !ID_EDEFAULT.equals(getId());
case ArchitecturePackage.ACTOR__ROLES:
return !getRoles().isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class> baseClass) {
if (baseClass == StringIdentity.class) {
switch (derivedFeatureID) {
case ArchitecturePackage.ACTOR__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.ACTOR__ID;
default: return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
} //ActorImpl