/*- * ============LICENSE_START========================================== * OPENECOMP - DCAE * =================================================================== * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END============================================ */ /** */ package org.openecomp.ncomp.cdap.impl; import org.openecomp.ncomp.cdap.CdapApplication; import org.openecomp.ncomp.cdap.CdapArtifact; import org.openecomp.ncomp.cdap.CdapPackage; import org.openecomp.ncomp.core.impl.NamedEntityImpl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; /** * * An implementation of the model object 'Application'. * *

* The following features are implemented: *

*

* * @generated */ public class CdapApplicationImpl extends NamedEntityImpl implements CdapApplication { /** * The default value of the '{@link #getType() Type}' attribute. * * * @see #getType() * @generated * @ordered */ protected static final String TYPE_EDEFAULT = null; /** * The cached value of the '{@link #getType() Type}' attribute. * * * @see #getType() * @generated * @ordered */ protected String type = TYPE_EDEFAULT; /** * The default value of the '{@link #getId() Id}' attribute. * * * @see #getId() * @generated * @ordered */ protected static final String ID_EDEFAULT = null; /** * The cached value of the '{@link #getId() Id}' attribute. * * * @see #getId() * @generated * @ordered */ protected String id = ID_EDEFAULT; /** * The default value of the '{@link #getVersion() Version}' attribute. * * * @see #getVersion() * @generated * @ordered */ protected static final String VERSION_EDEFAULT = null; /** * The cached value of the '{@link #getVersion() Version}' attribute. * * * @see #getVersion() * @generated * @ordered */ protected String version = VERSION_EDEFAULT; /** * The default value of the '{@link #getDescription() Description}' attribute. * * * @see #getDescription() * @generated * @ordered */ protected static final String DESCRIPTION_EDEFAULT = null; /** * The cached value of the '{@link #getDescription() Description}' attribute. * * * @see #getDescription() * @generated * @ordered */ protected String description = DESCRIPTION_EDEFAULT; /** * The cached value of the '{@link #getArtifact() Artifact}' containment reference. * * * @see #getArtifact() * @generated * @ordered */ protected CdapArtifact artifact; /** * * * @generated */ protected CdapApplicationImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return CdapPackage.Literals.CDAP_APPLICATION; } /** * * * @generated */ public String getType() { return type; } /** * * * @generated */ public void setType(String newType) { String oldType = type; type = newType; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CdapPackage.CDAP_APPLICATION__TYPE, oldType, type)); } /** * * * @generated */ public String getId() { return id; } /** * * * @generated */ public void setId(String newId) { String oldId = id; id = newId; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CdapPackage.CDAP_APPLICATION__ID, oldId, id)); } /** * * * @generated */ public String getVersion() { return version; } /** * * * @generated */ public void setVersion(String newVersion) { String oldVersion = version; version = newVersion; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CdapPackage.CDAP_APPLICATION__VERSION, oldVersion, version)); } /** * * * @generated */ public String getDescription() { return description; } /** * * * @generated */ public void setDescription(String newDescription) { String oldDescription = description; description = newDescription; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CdapPackage.CDAP_APPLICATION__DESCRIPTION, oldDescription, description)); } /** * * * @generated */ public CdapArtifact getArtifact() { return artifact; } /** * * * @generated */ public NotificationChain basicSetArtifact(CdapArtifact newArtifact, NotificationChain msgs) { CdapArtifact oldArtifact = artifact; artifact = newArtifact; if (eNotificationRequired()) { ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CdapPackage.CDAP_APPLICATION__ARTIFACT, oldArtifact, newArtifact); if (msgs == null) msgs = notification; else msgs.add(notification); } return msgs; } /** * * * @generated */ public void setArtifact(CdapArtifact newArtifact) { if (newArtifact != artifact) { NotificationChain msgs = null; if (artifact != null) msgs = ((InternalEObject)artifact).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CdapPackage.CDAP_APPLICATION__ARTIFACT, null, msgs); if (newArtifact != null) msgs = ((InternalEObject)newArtifact).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CdapPackage.CDAP_APPLICATION__ARTIFACT, null, msgs); msgs = basicSetArtifact(newArtifact, msgs); if (msgs != null) msgs.dispatch(); } else if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CdapPackage.CDAP_APPLICATION__ARTIFACT, newArtifact, newArtifact)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case CdapPackage.CDAP_APPLICATION__ARTIFACT: return basicSetArtifact(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case CdapPackage.CDAP_APPLICATION__TYPE: return getType(); case CdapPackage.CDAP_APPLICATION__ID: return getId(); case CdapPackage.CDAP_APPLICATION__VERSION: return getVersion(); case CdapPackage.CDAP_APPLICATION__DESCRIPTION: return getDescription(); case CdapPackage.CDAP_APPLICATION__ARTIFACT: return getArtifact(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case CdapPackage.CDAP_APPLICATION__TYPE: setType((String)newValue); return; case CdapPackage.CDAP_APPLICATION__ID: setId((String)newValue); return; case CdapPackage.CDAP_APPLICATION__VERSION: setVersion((String)newValue); return; case CdapPackage.CDAP_APPLICATION__DESCRIPTION: setDescription((String)newValue); return; case CdapPackage.CDAP_APPLICATION__ARTIFACT: setArtifact((CdapArtifact)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case CdapPackage.CDAP_APPLICATION__TYPE: setType(TYPE_EDEFAULT); return; case CdapPackage.CDAP_APPLICATION__ID: setId(ID_EDEFAULT); return; case CdapPackage.CDAP_APPLICATION__VERSION: setVersion(VERSION_EDEFAULT); return; case CdapPackage.CDAP_APPLICATION__DESCRIPTION: setDescription(DESCRIPTION_EDEFAULT); return; case CdapPackage.CDAP_APPLICATION__ARTIFACT: setArtifact((CdapArtifact)null); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case CdapPackage.CDAP_APPLICATION__TYPE: return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); case CdapPackage.CDAP_APPLICATION__ID: return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); case CdapPackage.CDAP_APPLICATION__VERSION: return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version); case CdapPackage.CDAP_APPLICATION__DESCRIPTION: return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description); case CdapPackage.CDAP_APPLICATION__ARTIFACT: return artifact != null; } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (type: "); result.append(type); result.append(", id: "); result.append(id); result.append(", version: "); result.append(version); result.append(", description: "); result.append(description); result.append(')'); return result.toString(); } } //CdapApplicationImpl