/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.eclipse.buckminster.rmap.maven.impl;
import org.eclipse.buckminster.rmap.maven.GroupAndArtifact;
import org.eclipse.buckminster.rmap.maven.MavenPackage;
import org.eclipse.buckminster.runtime.Trivial;
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.EObjectImpl;
/**
* <!-- begin-user-doc --> An implementation of the model object '
* <em><b>Group And Artifact</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>
* {@link org.eclipse.buckminster.rmap.maven.impl.GroupAndArtifactImpl#getArtifactId
* <em>Artifact Id</em>}</li>
* <li>
* {@link org.eclipse.buckminster.rmap.maven.impl.GroupAndArtifactImpl#getGroupId
* <em>Group Id</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class GroupAndArtifactImpl extends EObjectImpl implements GroupAndArtifact {
/**
* The default value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
* attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getArtifactId()
* @generated
* @ordered
*/
protected static final String ARTIFACT_ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getArtifactId() <em>Artifact Id</em>}'
* attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getArtifactId()
* @generated
* @ordered
*/
protected String artifactId = ARTIFACT_ID_EDEFAULT;
/**
* The default value of the '{@link #getGroupId() <em>Group Id</em>}'
* attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getGroupId()
* @generated
* @ordered
*/
protected static final String GROUP_ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getGroupId() <em>Group Id</em>}'
* attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getGroupId()
* @generated
* @ordered
*/
protected String groupId = GROUP_ID_EDEFAULT;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected GroupAndArtifactImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case MavenPackage.GROUP_AND_ARTIFACT__ARTIFACT_ID:
return getArtifactId();
case MavenPackage.GROUP_AND_ARTIFACT__GROUP_ID:
return getGroupId();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case MavenPackage.GROUP_AND_ARTIFACT__ARTIFACT_ID:
return ARTIFACT_ID_EDEFAULT == null ? artifactId != null : !ARTIFACT_ID_EDEFAULT.equals(artifactId);
case MavenPackage.GROUP_AND_ARTIFACT__GROUP_ID:
return GROUP_ID_EDEFAULT == null ? groupId != null : !GROUP_ID_EDEFAULT.equals(groupId);
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case MavenPackage.GROUP_AND_ARTIFACT__ARTIFACT_ID:
setArtifactId((String) newValue);
return;
case MavenPackage.GROUP_AND_ARTIFACT__GROUP_ID:
setGroupId((String) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case MavenPackage.GROUP_AND_ARTIFACT__ARTIFACT_ID:
setArtifactId(ARTIFACT_ID_EDEFAULT);
return;
case MavenPackage.GROUP_AND_ARTIFACT__GROUP_ID:
setGroupId(GROUP_ID_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public String getArtifactId() {
return artifactId;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public String getGroupId() {
return groupId;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
@Override
public boolean isMatchFor(String group, String artifact) {
return Trivial.equalsAllowNull(getGroupId(), group) && Trivial.equalsAllowNull(getArtifactId(), artifact);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setArtifactId(String newArtifactId) {
String oldArtifactId = artifactId;
artifactId = newArtifactId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MavenPackage.GROUP_AND_ARTIFACT__ARTIFACT_ID, oldArtifactId, artifactId));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setGroupId(String newGroupId) {
String oldGroupId = groupId;
groupId = newGroupId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MavenPackage.GROUP_AND_ARTIFACT__GROUP_ID, oldGroupId, groupId));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (artifactId: ");
result.append(artifactId);
result.append(", groupId: ");
result.append(groupId);
result.append(')');
return result.toString();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return MavenPackage.Literals.GROUP_AND_ARTIFACT;
}
} // GroupAndArtifactImpl