blob: ab23b7a5d6fffe21240bac8e755f32e062d2cdae [file] [log] [blame]
/*****************************************************************************
* Copyright (c) 2019 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Yupanqui Munoz (CEA LIST) yupanqui.munozjulho@cea.fr - Initial API and implementation
* Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
*****************************************************************************/
package org.eclipse.papyrus.model2doc.integration.ieee.requirements.documentation.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.model2doc.integration.ieee.requirements.documentation.IEEERequirementCategory;
import org.eclipse.papyrus.model2doc.integration.ieee.requirements.documentation.IEEERequirements;
import org.eclipse.papyrus.model2doc.integration.ieee.requirements.documentation.IEEERequirementsDocumentationPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>IEEE Requirements</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.model2doc.integration.ieee.requirements.documentation.impl.IEEERequirementsImpl#getCategory <em>Category</em>}</li>
* </ul>
*
* @generated
*/
public class IEEERequirementsImpl extends AbstractRequirementsImpl implements IEEERequirements {
/**
* The default value of the '{@link #getCategory() <em>Category</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCategory()
* @generated
* @ordered
*/
protected static final IEEERequirementCategory CATEGORY_EDEFAULT = IEEERequirementCategory.SPECIFIC_REQUIREMENTS;
/**
* The cached value of the '{@link #getCategory() <em>Category</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCategory()
* @generated
* @ordered
*/
protected IEEERequirementCategory category = CATEGORY_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IEEERequirementsImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return IEEERequirementsDocumentationPackage.Literals.IEEE_REQUIREMENTS;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public IEEERequirementCategory getCategory() {
return category;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setCategory(IEEERequirementCategory newCategory) {
IEEERequirementCategory oldCategory = category;
category = newCategory == null ? CATEGORY_EDEFAULT : newCategory;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, IEEERequirementsDocumentationPackage.IEEE_REQUIREMENTS__CATEGORY, oldCategory, category));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case IEEERequirementsDocumentationPackage.IEEE_REQUIREMENTS__CATEGORY:
return getCategory();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case IEEERequirementsDocumentationPackage.IEEE_REQUIREMENTS__CATEGORY:
setCategory((IEEERequirementCategory) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case IEEERequirementsDocumentationPackage.IEEE_REQUIREMENTS__CATEGORY:
setCategory(CATEGORY_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case IEEERequirementsDocumentationPackage.IEEE_REQUIREMENTS__CATEGORY:
return category != CATEGORY_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) {
return super.toString();
}
StringBuilder result = new StringBuilder(super.toString());
result.append(" (category: "); //$NON-NLS-1$
result.append(category);
result.append(')');
return result.toString();
}
} //IEEERequirementsImpl