/*-
* ============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.openstack.location.impl;
import org.openecomp.ncomp.openstack.location.HypervisorService;
import org.openecomp.ncomp.openstack.location.LocationPackage;
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;
/**
*
* An implementation of the model object 'Hypervisor Service'.
*
*
* The following features are implemented:
*
*
* - {@link org.openecomp.ncomp.openstack.location.impl.HypervisorServiceImpl#getHost Host}
* - {@link org.openecomp.ncomp.openstack.location.impl.HypervisorServiceImpl#getId Id}
*
*
* @generated
*/
public class HypervisorServiceImpl extends MinimalEObjectImpl.Container implements HypervisorService {
/**
* The default value of the '{@link #getHost() Host}' attribute.
*
*
* @see #getHost()
* @generated
* @ordered
*/
protected static final String HOST_EDEFAULT = null;
/**
* The cached value of the '{@link #getHost() Host}' attribute.
*
*
* @see #getHost()
* @generated
* @ordered
*/
protected String host = HOST_EDEFAULT;
/**
* The default value of the '{@link #getId() Id}' attribute.
*
*
* @see #getId()
* @generated
* @ordered
*/
protected static final int ID_EDEFAULT = 0;
/**
* The cached value of the '{@link #getId() Id}' attribute.
*
*
* @see #getId()
* @generated
* @ordered
*/
protected int id = ID_EDEFAULT;
/**
*
*
* @generated
*/
protected HypervisorServiceImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return LocationPackage.Literals.HYPERVISOR_SERVICE;
}
/**
*
*
* @generated
*/
public String getHost() {
return host;
}
/**
*
*
* @generated
*/
public void setHost(String newHost) {
String oldHost = host;
host = newHost;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LocationPackage.HYPERVISOR_SERVICE__HOST, oldHost, host));
}
/**
*
*
* @generated
*/
public int getId() {
return id;
}
/**
*
*
* @generated
*/
public void setId(int newId) {
int oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, LocationPackage.HYPERVISOR_SERVICE__ID, oldId, id));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case LocationPackage.HYPERVISOR_SERVICE__HOST:
return getHost();
case LocationPackage.HYPERVISOR_SERVICE__ID:
return getId();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case LocationPackage.HYPERVISOR_SERVICE__HOST:
setHost((String)newValue);
return;
case LocationPackage.HYPERVISOR_SERVICE__ID:
setId((Integer)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case LocationPackage.HYPERVISOR_SERVICE__HOST:
setHost(HOST_EDEFAULT);
return;
case LocationPackage.HYPERVISOR_SERVICE__ID:
setId(ID_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case LocationPackage.HYPERVISOR_SERVICE__HOST:
return HOST_EDEFAULT == null ? host != null : !HOST_EDEFAULT.equals(host);
case LocationPackage.HYPERVISOR_SERVICE__ID:
return id != ID_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (host: ");
result.append(host);
result.append(", id: ");
result.append(id);
result.append(')');
return result.toString();
}
} //HypervisorServiceImpl