/** */ package monoge.dsl.extension.impl; import monoge.dsl.extension.AddConstraint; import monoge.dsl.extension.ExtensionPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Add Constraint</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link monoge.dsl.extension.impl.AddConstraintImpl#getConstraint <em>Constraint</em>}</li> * <li>{@link monoge.dsl.extension.impl.AddConstraintImpl#getValue <em>Value</em>}</li> * </ul> * </p> * * @generated */ public class AddConstraintImpl extends ModifyOperatorImpl implements AddConstraint { /** * The default value of the '{@link #getConstraint() <em>Constraint</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getConstraint() * @generated * @ordered */ protected static final String CONSTRAINT_EDEFAULT = null; /** * The cached value of the '{@link #getConstraint() <em>Constraint</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getConstraint() * @generated * @ordered */ protected String constraint = CONSTRAINT_EDEFAULT; /** * The default value of the '{@link #getValue() <em>Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getValue() * @generated * @ordered */ protected static final String VALUE_EDEFAULT = null; /** * The cached value of the '{@link #getValue() <em>Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getValue() * @generated * @ordered */ protected String value = VALUE_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected AddConstraintImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return ExtensionPackage.Literals.ADD_CONSTRAINT; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getConstraint() { return constraint; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setConstraint(String newConstraint) { String oldConstraint = constraint; constraint = newConstraint; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ExtensionPackage.ADD_CONSTRAINT__CONSTRAINT, oldConstraint, constraint)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getValue() { return value; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setValue(String newValue) { String oldValue = value; value = newValue; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, ExtensionPackage.ADD_CONSTRAINT__VALUE, oldValue, value)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case ExtensionPackage.ADD_CONSTRAINT__CONSTRAINT: return getConstraint(); case ExtensionPackage.ADD_CONSTRAINT__VALUE: return getValue(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case ExtensionPackage.ADD_CONSTRAINT__CONSTRAINT: setConstraint((String)newValue); return; case ExtensionPackage.ADD_CONSTRAINT__VALUE: setValue((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case ExtensionPackage.ADD_CONSTRAINT__CONSTRAINT: setConstraint(CONSTRAINT_EDEFAULT); return; case ExtensionPackage.ADD_CONSTRAINT__VALUE: setValue(VALUE_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case ExtensionPackage.ADD_CONSTRAINT__CONSTRAINT: return CONSTRAINT_EDEFAULT == null ? constraint != null : !CONSTRAINT_EDEFAULT.equals(constraint); case ExtensionPackage.ADD_CONSTRAINT__VALUE: return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); } return super.eIsSet(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (constraint: "); result.append(constraint); result.append(", value: "); result.append(value); result.append(')'); return result.toString(); } } //AddConstraintImpl