blob: a68bf1f2640ea3c9a0251aee16e0215f4dcd8bda [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.papyrus.requirements.sysml14.boilerplateText.BoilerplateTextPackage;
import org.eclipse.papyrus.requirements.sysml14.boilerplateText.ShallAllow;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Shall Allow</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.requirements.sysml14.boilerplateText.impl.ShallAllowImpl#getEntity <em>Entity</em>}</li>
* <li>{@link org.eclipse.papyrus.requirements.sysml14.boilerplateText.impl.ShallAllowImpl#getActionPerformedByEntity <em>Action Performed By Entity</em>}</li>
* </ul>
*
* @generated
*/
public class ShallAllowImpl extends PredicateImpl implements ShallAllow
{
/**
* The default value of the '{@link #getEntity() <em>Entity</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEntity()
* @generated
* @ordered
*/
protected static final String ENTITY_EDEFAULT = null;
/**
* The cached value of the '{@link #getEntity() <em>Entity</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEntity()
* @generated
* @ordered
*/
protected String entity = ENTITY_EDEFAULT;
/**
* The default value of the '{@link #getActionPerformedByEntity() <em>Action Performed By Entity</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getActionPerformedByEntity()
* @generated
* @ordered
*/
protected static final String ACTION_PERFORMED_BY_ENTITY_EDEFAULT = null;
/**
* The cached value of the '{@link #getActionPerformedByEntity() <em>Action Performed By Entity</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getActionPerformedByEntity()
* @generated
* @ordered
*/
protected String actionPerformedByEntity = ACTION_PERFORMED_BY_ENTITY_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ShallAllowImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return BoilerplateTextPackage.Literals.SHALL_ALLOW;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getEntity()
{
return entity;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setEntity(String newEntity)
{
String oldEntity = entity;
entity = newEntity;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BoilerplateTextPackage.SHALL_ALLOW__ENTITY, oldEntity, entity));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getActionPerformedByEntity()
{
return actionPerformedByEntity;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setActionPerformedByEntity(String newActionPerformedByEntity)
{
String oldActionPerformedByEntity = actionPerformedByEntity;
actionPerformedByEntity = newActionPerformedByEntity;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BoilerplateTextPackage.SHALL_ALLOW__ACTION_PERFORMED_BY_ENTITY, oldActionPerformedByEntity, actionPerformedByEntity));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
switch (featureID)
{
case BoilerplateTextPackage.SHALL_ALLOW__ENTITY:
return getEntity();
case BoilerplateTextPackage.SHALL_ALLOW__ACTION_PERFORMED_BY_ENTITY:
return getActionPerformedByEntity();
}
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.SHALL_ALLOW__ENTITY:
setEntity((String)newValue);
return;
case BoilerplateTextPackage.SHALL_ALLOW__ACTION_PERFORMED_BY_ENTITY:
setActionPerformedByEntity((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID)
{
switch (featureID)
{
case BoilerplateTextPackage.SHALL_ALLOW__ENTITY:
setEntity(ENTITY_EDEFAULT);
return;
case BoilerplateTextPackage.SHALL_ALLOW__ACTION_PERFORMED_BY_ENTITY:
setActionPerformedByEntity(ACTION_PERFORMED_BY_ENTITY_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case BoilerplateTextPackage.SHALL_ALLOW__ENTITY:
return ENTITY_EDEFAULT == null ? entity != null : !ENTITY_EDEFAULT.equals(entity);
case BoilerplateTextPackage.SHALL_ALLOW__ACTION_PERFORMED_BY_ENTITY:
return ACTION_PERFORMED_BY_ENTITY_EDEFAULT == null ? actionPerformedByEntity != null : !ACTION_PERFORMED_BY_ENTITY_EDEFAULT.equals(actionPerformedByEntity);
}
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(" (entity: ");
result.append(entity);
result.append(", actionPerformedByEntity: ");
result.append(actionPerformedByEntity);
result.append(')');
return result.toString();
}
} //ShallAllowImpl