/*-
* ============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.core.impl;
import org.openecomp.ncomp.core.CorePackage;
import org.openecomp.ncomp.core.DeploymentStatus;
import org.openecomp.ncomp.core.User;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
*
* An implementation of the model object 'User'.
*
*
* The following features are implemented:
*
* - {@link org.openecomp.ncomp.core.impl.UserImpl#getPublicKey Public Key}
* - {@link org.openecomp.ncomp.core.impl.UserImpl#getDeploymentStatus Deployment Status}
*
*
*
* @generated
*/
public class UserImpl extends NamedEntityImpl implements User {
/**
* The default value of the '{@link #getPublicKey() Public Key}' attribute.
*
*
* @see #getPublicKey()
* @generated
* @ordered
*/
protected static final String PUBLIC_KEY_EDEFAULT = null;
/**
* The cached value of the '{@link #getPublicKey() Public Key}' attribute.
*
*
* @see #getPublicKey()
* @generated
* @ordered
*/
protected String publicKey = PUBLIC_KEY_EDEFAULT;
/**
* The default value of the '{@link #getDeploymentStatus() Deployment Status}' attribute.
*
*
* @see #getDeploymentStatus()
* @generated
* @ordered
*/
protected static final DeploymentStatus DEPLOYMENT_STATUS_EDEFAULT = DeploymentStatus.UNDEPLOYED;
/**
* The cached value of the '{@link #getDeploymentStatus() Deployment Status}' attribute.
*
*
* @see #getDeploymentStatus()
* @generated
* @ordered
*/
protected DeploymentStatus deploymentStatus = DEPLOYMENT_STATUS_EDEFAULT;
/**
*
*
* @generated
*/
protected UserImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return CorePackage.Literals.USER;
}
/**
*
*
* @generated
*/
public String getPublicKey() {
return publicKey;
}
/**
*
*
* @generated
*/
public void setPublicKey(String newPublicKey) {
String oldPublicKey = publicKey;
publicKey = newPublicKey;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.USER__PUBLIC_KEY, oldPublicKey, publicKey));
}
/**
*
*
* @generated
*/
public DeploymentStatus getDeploymentStatus() {
return deploymentStatus;
}
/**
*
*
* @generated
*/
public void setDeploymentStatus(DeploymentStatus newDeploymentStatus) {
DeploymentStatus oldDeploymentStatus = deploymentStatus;
deploymentStatus = newDeploymentStatus == null ? DEPLOYMENT_STATUS_EDEFAULT : newDeploymentStatus;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CorePackage.USER__DEPLOYMENT_STATUS, oldDeploymentStatus, deploymentStatus));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case CorePackage.USER__PUBLIC_KEY:
return getPublicKey();
case CorePackage.USER__DEPLOYMENT_STATUS:
return getDeploymentStatus();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CorePackage.USER__PUBLIC_KEY:
setPublicKey((String)newValue);
return;
case CorePackage.USER__DEPLOYMENT_STATUS:
setDeploymentStatus((DeploymentStatus)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CorePackage.USER__PUBLIC_KEY:
setPublicKey(PUBLIC_KEY_EDEFAULT);
return;
case CorePackage.USER__DEPLOYMENT_STATUS:
setDeploymentStatus(DEPLOYMENT_STATUS_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CorePackage.USER__PUBLIC_KEY:
return PUBLIC_KEY_EDEFAULT == null ? publicKey != null : !PUBLIC_KEY_EDEFAULT.equals(publicKey);
case CorePackage.USER__DEPLOYMENT_STATUS:
return deploymentStatus != DEPLOYMENT_STATUS_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (publicKey: ");
result.append(publicKey);
result.append(", deploymentStatus: ");
result.append(deploymentStatus);
result.append(')');
return result.toString();
}
} //UserImpl