kieker.model.analysismodel.deployment.impl.EStringToDeployedComponentMapEntryImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of model Show documentation
Show all versions of model Show documentation
Kieker: Application Performance Monitoring and Dynamic Software Analysis
The newest version!
/**
*/
package kieker.model.analysismodel.deployment.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.BasicEMap;
import org.eclipse.emf.common.util.EMap;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import kieker.model.analysismodel.deployment.DeployedComponent;
import kieker.model.analysismodel.deployment.DeploymentPackage;
/**
*
* An implementation of the model object 'EString To Deployed Component Map Entry'.
*
*
* The following features are implemented:
*
*
* - {@link kieker.model.analysismodel.deployment.impl.EStringToDeployedComponentMapEntryImpl#getTypedKey Key}
* - {@link kieker.model.analysismodel.deployment.impl.EStringToDeployedComponentMapEntryImpl#getTypedValue Value}
*
*
* @generated
*/
public class EStringToDeployedComponentMapEntryImpl extends MinimalEObjectImpl.Container implements BasicEMap.Entry {
/**
* The default value of the '{@link #getTypedKey() Key}' attribute.
*
*
*
* @see #getTypedKey()
* @generated
* @ordered
*/
protected static final String KEY_EDEFAULT = null;
/**
* The cached value of the '{@link #getTypedKey() Key}' attribute.
*
*
*
* @see #getTypedKey()
* @generated
* @ordered
*/
protected String key = KEY_EDEFAULT;
/**
* The cached value of the '{@link #getTypedValue() Value}' containment reference.
*
*
*
* @see #getTypedValue()
* @generated
* @ordered
*/
protected DeployedComponent value;
/**
*
*
*
* @generated
*/
protected EStringToDeployedComponentMapEntryImpl() {
super();
}
/**
*
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return DeploymentPackage.Literals.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY;
}
/**
*
*
*
* @generated
*/
public String getTypedKey() {
return this.key;
}
/**
*
*
*
* @generated
*/
public void setTypedKey(final String newKey) {
final String oldKey = this.key;
this.key = newKey;
if (this.eNotificationRequired()) {
this.eNotify(new ENotificationImpl(this, Notification.SET, DeploymentPackage.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY__KEY, oldKey, this.key));
}
}
/**
*
*
*
* @generated
*/
public DeployedComponent getTypedValue() {
return this.value;
}
/**
*
*
*
* @generated
*/
public NotificationChain basicSetTypedValue(final DeployedComponent newValue, NotificationChain msgs) {
final DeployedComponent oldValue = this.value;
this.value = newValue;
if (this.eNotificationRequired()) {
final ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DeploymentPackage.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY__VALUE,
oldValue, newValue);
if (msgs == null) {
msgs = notification;
} else {
msgs.add(notification);
}
}
return msgs;
}
/**
*
*
*
* @generated
*/
public void setTypedValue(final DeployedComponent newValue) {
if (newValue != this.value) {
NotificationChain msgs = null;
if (this.value != null) {
msgs = ((InternalEObject) this.value).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - DeploymentPackage.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY__VALUE,
null, msgs);
}
if (newValue != null) {
msgs = ((InternalEObject) newValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - DeploymentPackage.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY__VALUE,
null, msgs);
}
msgs = this.basicSetTypedValue(newValue, msgs);
if (msgs != null) {
msgs.dispatch();
}
} else if (this.eNotificationRequired()) {
this.eNotify(new ENotificationImpl(this, Notification.SET, DeploymentPackage.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY__VALUE, newValue, newValue));
}
}
/**
*
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(final InternalEObject otherEnd, final int featureID, final NotificationChain msgs) {
switch (featureID) {
case DeploymentPackage.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY__VALUE:
return this.basicSetTypedValue(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
*
* @generated
*/
@Override
public Object eGet(final int featureID, final boolean resolve, final boolean coreType) {
switch (featureID) {
case DeploymentPackage.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY__KEY:
return this.getTypedKey();
case DeploymentPackage.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY__VALUE:
return this.getTypedValue();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
*
* @generated
*/
@Override
public void eSet(final int featureID, final Object newValue) {
switch (featureID) {
case DeploymentPackage.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY__KEY:
this.setTypedKey((String) newValue);
return;
case DeploymentPackage.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY__VALUE:
this.setTypedValue((DeployedComponent) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
*
* @generated
*/
@Override
public void eUnset(final int featureID) {
switch (featureID) {
case DeploymentPackage.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY__KEY:
this.setTypedKey(KEY_EDEFAULT);
return;
case DeploymentPackage.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY__VALUE:
this.setTypedValue((DeployedComponent) null);
return;
}
super.eUnset(featureID);
}
/**
*
*
*
* @generated
*/
@Override
public boolean eIsSet(final int featureID) {
switch (featureID) {
case DeploymentPackage.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY__KEY:
return KEY_EDEFAULT == null ? this.key != null : !KEY_EDEFAULT.equals(this.key);
case DeploymentPackage.ESTRING_TO_DEPLOYED_COMPONENT_MAP_ENTRY__VALUE:
return this.value != null;
}
return super.eIsSet(featureID);
}
/**
*
*
*
* @generated
*/
@Override
public String toString() {
if (this.eIsProxy()) {
return super.toString();
}
final StringBuilder result = new StringBuilder(super.toString());
result.append(" (key: ");
result.append(this.key);
result.append(')');
return result.toString();
}
/**
*
*
*
* @generated
*/
protected int hash = -1;
/**
*
*
*
* @generated
*/
@Override
public int getHash() {
if (this.hash == -1) {
final Object theKey = this.getKey();
this.hash = (theKey == null ? 0 : theKey.hashCode());
}
return this.hash;
}
/**
*
*
*
* @generated
*/
@Override
public void setHash(final int hash) {
this.hash = hash;
}
/**
*
*
*
* @generated
*/
@Override
public String getKey() {
return this.getTypedKey();
}
/**
*
*
*
* @generated
*/
@Override
public void setKey(final String key) {
this.setTypedKey(key);
}
/**
*
*
*
* @generated
*/
@Override
public DeployedComponent getValue() {
return this.getTypedValue();
}
/**
*
*
*
* @generated
*/
@Override
public DeployedComponent setValue(final DeployedComponent value) {
final DeployedComponent oldValue = this.getValue();
this.setTypedValue(value);
return oldValue;
}
/**
*
*
*
* @generated
*/
@SuppressWarnings("unchecked")
public EMap getEMap() {
final EObject container = this.eContainer();
return container == null ? null : (EMap) container.eGet(this.eContainmentFeature());
}
} // EStringToDeployedComponentMapEntryImpl