/** * <copyright> * </copyright> * */ package org.eclipse.papyrus.uml.textedit.transition.xtext.umlTransition.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.papyrus.uml.textedit.transition.xtext.umlTransition.GuardRule; import org.eclipse.papyrus.uml.textedit.transition.xtext.umlTransition.UmlTransitionPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Guard Rule</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.papyrus.uml.textedit.transition.xtext.umlTransition.impl.GuardRuleImpl#getConstraint <em>Constraint</em>}</li> * </ul> * </p> * * @generated */ public class GuardRuleImpl extends MinimalEObjectImpl.Container implements GuardRule { /** * 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; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected GuardRuleImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return UmlTransitionPackage.Literals.GUARD_RULE; } /** * <!-- 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, UmlTransitionPackage.GUARD_RULE__CONSTRAINT, oldConstraint, constraint)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case UmlTransitionPackage.GUARD_RULE__CONSTRAINT: return getConstraint(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case UmlTransitionPackage.GUARD_RULE__CONSTRAINT: setConstraint((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case UmlTransitionPackage.GUARD_RULE__CONSTRAINT: setConstraint(CONSTRAINT_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case UmlTransitionPackage.GUARD_RULE__CONSTRAINT: return CONSTRAINT_EDEFAULT == null ? constraint != null : !CONSTRAINT_EDEFAULT.equals(constraint); } 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(')'); return result.toString(); } } //GuardRuleImpl