/** */ package de.gebit.integrity.dsl.impl; import de.gebit.integrity.dsl.DslPackage; import de.gebit.integrity.dsl.KeyValuePair; import de.gebit.integrity.dsl.NestedObject; 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.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Nested Object</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * </p> * <ul> * <li>{@link de.gebit.integrity.dsl.impl.NestedObjectImpl#getAttributes <em>Attributes</em>}</li> * </ul> * * @generated */ public class NestedObjectImpl extends ValueImpl implements NestedObject { /** * The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getAttributes() * @generated * @ordered */ protected EList<KeyValuePair> attributes; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected NestedObjectImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return DslPackage.Literals.NESTED_OBJECT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<KeyValuePair> getAttributes() { if (attributes == null) { attributes = new EObjectContainmentEList<KeyValuePair>(KeyValuePair.class, this, DslPackage.NESTED_OBJECT__ATTRIBUTES); } return attributes; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case DslPackage.NESTED_OBJECT__ATTRIBUTES: return ((InternalEList<?>)getAttributes()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case DslPackage.NESTED_OBJECT__ATTRIBUTES: return getAttributes(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case DslPackage.NESTED_OBJECT__ATTRIBUTES: getAttributes().clear(); getAttributes().addAll((Collection<? extends KeyValuePair>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case DslPackage.NESTED_OBJECT__ATTRIBUTES: getAttributes().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case DslPackage.NESTED_OBJECT__ATTRIBUTES: return attributes != null && !attributes.isEmpty(); } return super.eIsSet(featureID); } } //NestedObjectImpl