/*-
* ============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.compute.impl;
import org.openecomp.ncomp.openstack.compute.ComputePackage;
import org.openecomp.ncomp.openstack.compute.Fault;
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 'Fault'.
*
*
* The following features are implemented:
*
* - {@link org.openecomp.ncomp.openstack.compute.impl.FaultImpl#getMessage Message}
* - {@link org.openecomp.ncomp.openstack.compute.impl.FaultImpl#getCreated Created}
* - {@link org.openecomp.ncomp.openstack.compute.impl.FaultImpl#getCode Code}
*
*
*
* @generated
*/
public class FaultImpl extends MinimalEObjectImpl.Container implements Fault {
/**
* The default value of the '{@link #getMessage() Message}' attribute.
*
*
* @see #getMessage()
* @generated
* @ordered
*/
protected static final String MESSAGE_EDEFAULT = null;
/**
* The cached value of the '{@link #getMessage() Message}' attribute.
*
*
* @see #getMessage()
* @generated
* @ordered
*/
protected String message = MESSAGE_EDEFAULT;
/**
* The default value of the '{@link #getCreated() Created}' attribute.
*
*
* @see #getCreated()
* @generated
* @ordered
*/
protected static final String CREATED_EDEFAULT = null;
/**
* The cached value of the '{@link #getCreated() Created}' attribute.
*
*
* @see #getCreated()
* @generated
* @ordered
*/
protected String created = CREATED_EDEFAULT;
/**
* The default value of the '{@link #getCode() Code}' attribute.
*
*
* @see #getCode()
* @generated
* @ordered
*/
protected static final int CODE_EDEFAULT = 0;
/**
* The cached value of the '{@link #getCode() Code}' attribute.
*
*
* @see #getCode()
* @generated
* @ordered
*/
protected int code = CODE_EDEFAULT;
/**
*
*
* @generated
*/
protected FaultImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ComputePackage.Literals.FAULT;
}
/**
*
*
* @generated
*/
public String getMessage() {
return message;
}
/**
*
*
* @generated
*/
public void setMessage(String newMessage) {
String oldMessage = message;
message = newMessage;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComputePackage.FAULT__MESSAGE, oldMessage, message));
}
/**
*
*
* @generated
*/
public String getCreated() {
return created;
}
/**
*
*
* @generated
*/
public void setCreated(String newCreated) {
String oldCreated = created;
created = newCreated;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComputePackage.FAULT__CREATED, oldCreated, created));
}
/**
*
*
* @generated
*/
public int getCode() {
return code;
}
/**
*
*
* @generated
*/
public void setCode(int newCode) {
int oldCode = code;
code = newCode;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComputePackage.FAULT__CODE, oldCode, code));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ComputePackage.FAULT__MESSAGE:
return getMessage();
case ComputePackage.FAULT__CREATED:
return getCreated();
case ComputePackage.FAULT__CODE:
return getCode();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ComputePackage.FAULT__MESSAGE:
setMessage((String)newValue);
return;
case ComputePackage.FAULT__CREATED:
setCreated((String)newValue);
return;
case ComputePackage.FAULT__CODE:
setCode((Integer)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ComputePackage.FAULT__MESSAGE:
setMessage(MESSAGE_EDEFAULT);
return;
case ComputePackage.FAULT__CREATED:
setCreated(CREATED_EDEFAULT);
return;
case ComputePackage.FAULT__CODE:
setCode(CODE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ComputePackage.FAULT__MESSAGE:
return MESSAGE_EDEFAULT == null ? message != null : !MESSAGE_EDEFAULT.equals(message);
case ComputePackage.FAULT__CREATED:
return CREATED_EDEFAULT == null ? created != null : !CREATED_EDEFAULT.equals(created);
case ComputePackage.FAULT__CODE:
return code != CODE_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (message: ");
result.append(message);
result.append(", created: ");
result.append(created);
result.append(", code: ");
result.append(code);
result.append(')');
return result.toString();
}
} //FaultImpl