blob: 14c43f210384feb1848563f69ad4fbef89311e8f [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 a; http://www.eclipse.org/legal/epl-v10.html Contributors: - Initial API and implementation Yupanqui Munoz Julho (CEA LIST) - Initial API and implementation
*/
package org.eclipse.papyrus.requirements.sysml.papyrusre.papyrusre.BasicRequirement.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.sysml.papyrusre.papyrusre.BasicRequirement.AuthorReq;
import org.eclipse.papyrus.requirements.sysml.papyrusre.papyrusre.BasicRequirement.BasicRequirementPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Author Req</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.papyrus.requirements.sysml.papyrusre.papyrusre.BasicRequirement.impl.AuthorReqImpl#getAuthor <em>Author</em>}</li>
* </ul>
*
* @generated
*/
public class AuthorReqImpl extends MinimalEObjectImpl.Container implements AuthorReq {
/**
* The default value of the '{@link #getAuthor() <em>Author</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAuthor()
* @generated
* @ordered
*/
protected static final String AUTHOR_EDEFAULT = null;
/**
* The cached value of the '{@link #getAuthor() <em>Author</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAuthor()
* @generated
* @ordered
*/
protected String author = AUTHOR_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AuthorReqImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BasicRequirementPackage.Literals.AUTHOR_REQ;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getAuthor() {
return author;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setAuthor(String newAuthor) {
String oldAuthor = author;
author = newAuthor;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BasicRequirementPackage.AUTHOR_REQ__AUTHOR, oldAuthor, author));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BasicRequirementPackage.AUTHOR_REQ__AUTHOR:
return getAuthor();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BasicRequirementPackage.AUTHOR_REQ__AUTHOR:
setAuthor((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BasicRequirementPackage.AUTHOR_REQ__AUTHOR:
setAuthor(AUTHOR_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BasicRequirementPackage.AUTHOR_REQ__AUTHOR:
return AUTHOR_EDEFAULT == null ? author != null : !AUTHOR_EDEFAULT.equals(author);
}
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(" (author: "); //$NON-NLS-1$
result.append(author);
result.append(')');
return result.toString();
}
} //AuthorReqImpl