blob: eb5ba7af62f6bff8b2a1d704ae21c7a3151ecd61 [file] [log] [blame]
/**
* ****************************************************************************
* Copyright (c) 2017 CEA LIST.
* *
* *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors:
*
* Mauricio Alferez (mauricio.alferez@cea.fr) CEA LIST - Initial API and implementation
* *
* ****************************************************************************
*
* generated by Xtext 2.11.0
*/
package org.eclipse.papyrus.requirements.sysml14.boilerplateText.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.requirements.sysml14.boilerplateText.BoilerplateTextPackage;
import org.eclipse.papyrus.requirements.sysml14.boilerplateText.Predicate;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Predicate</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.requirements.sysml14.boilerplateText.impl.PredicateImpl#getAction <em>Action</em>}</li>
* </ul>
*
* @generated
*/
public class PredicateImpl extends MinimalEObjectImpl.Container implements Predicate
{
/**
* The default value of the '{@link #getAction() <em>Action</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAction()
* @generated
* @ordered
*/
protected static final String ACTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getAction() <em>Action</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAction()
* @generated
* @ordered
*/
protected String action = ACTION_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected PredicateImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return BoilerplateTextPackage.Literals.PREDICATE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getAction()
{
return action;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAction(String newAction)
{
String oldAction = action;
action = newAction;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BoilerplateTextPackage.PREDICATE__ACTION, oldAction, action));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case BoilerplateTextPackage.PREDICATE__ACTION:
return getAction();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue)
{
switch (featureID)
{
case BoilerplateTextPackage.PREDICATE__ACTION:
setAction((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case BoilerplateTextPackage.PREDICATE__ACTION:
setAction(ACTION_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case BoilerplateTextPackage.PREDICATE__ACTION:
return ACTION_EDEFAULT == null ? action != null : !ACTION_EDEFAULT.equals(action);
}
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(" (action: ");
result.append(action);
result.append(')');
return result.toString();
}
} //PredicateImpl