/*-
* ============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.component.impl;
import org.openecomp.ncomp.component.ApiRequest;
import org.openecomp.ncomp.component.ApiRequestStatus;
import org.openecomp.ncomp.component.ComponentPackage;
import org.openecomp.ncomp.core.impl.EventImpl;
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 'Api Request'.
*
*
* The following features are implemented:
*
* - {@link org.openecomp.ncomp.component.impl.ApiRequestImpl#getComponentName Component Name}
* - {@link org.openecomp.ncomp.component.impl.ApiRequestImpl#getResourcePath Resource Path}
* - {@link org.openecomp.ncomp.component.impl.ApiRequestImpl#getTransactionId Transaction Id}
* - {@link org.openecomp.ncomp.component.impl.ApiRequestImpl#getParentTransactionId Parent Transaction Id}
* - {@link org.openecomp.ncomp.component.impl.ApiRequestImpl#getAction Action}
* - {@link org.openecomp.ncomp.component.impl.ApiRequestImpl#getDuration Duration}
* - {@link org.openecomp.ncomp.component.impl.ApiRequestImpl#getStatus Status}
*
*
*
* @generated
*/
public class ApiRequestImpl extends EventImpl implements ApiRequest {
/**
* The default value of the '{@link #getComponentName() Component Name}' attribute.
*
*
* @see #getComponentName()
* @generated
* @ordered
*/
protected static final String COMPONENT_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getComponentName() Component Name}' attribute.
*
*
* @see #getComponentName()
* @generated
* @ordered
*/
protected String componentName = COMPONENT_NAME_EDEFAULT;
/**
* The default value of the '{@link #getResourcePath() Resource Path}' attribute.
*
*
* @see #getResourcePath()
* @generated
* @ordered
*/
protected static final String RESOURCE_PATH_EDEFAULT = null;
/**
* The cached value of the '{@link #getResourcePath() Resource Path}' attribute.
*
*
* @see #getResourcePath()
* @generated
* @ordered
*/
protected String resourcePath = RESOURCE_PATH_EDEFAULT;
/**
* The default value of the '{@link #getTransactionId() Transaction Id}' attribute.
*
*
* @see #getTransactionId()
* @generated
* @ordered
*/
protected static final String TRANSACTION_ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getTransactionId() Transaction Id}' attribute.
*
*
* @see #getTransactionId()
* @generated
* @ordered
*/
protected String transactionId = TRANSACTION_ID_EDEFAULT;
/**
* The default value of the '{@link #getParentTransactionId() Parent Transaction Id}' attribute.
*
*
* @see #getParentTransactionId()
* @generated
* @ordered
*/
protected static final String PARENT_TRANSACTION_ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getParentTransactionId() Parent Transaction Id}' attribute.
*
*
* @see #getParentTransactionId()
* @generated
* @ordered
*/
protected String parentTransactionId = PARENT_TRANSACTION_ID_EDEFAULT;
/**
* The default value of the '{@link #getAction() Action}' attribute.
*
*
* @see #getAction()
* @generated
* @ordered
*/
protected static final String ACTION_EDEFAULT = null;
/**
* The cached value of the '{@link #getAction() Action}' attribute.
*
*
* @see #getAction()
* @generated
* @ordered
*/
protected String action = ACTION_EDEFAULT;
/**
* The default value of the '{@link #getDuration() Duration}' attribute.
*
*
* @see #getDuration()
* @generated
* @ordered
*/
protected static final Long DURATION_EDEFAULT = null;
/**
* The cached value of the '{@link #getDuration() Duration}' attribute.
*
*
* @see #getDuration()
* @generated
* @ordered
*/
protected Long duration = DURATION_EDEFAULT;
/**
* The default value of the '{@link #getStatus() Status}' attribute.
*
*
* @see #getStatus()
* @generated
* @ordered
*/
protected static final ApiRequestStatus STATUS_EDEFAULT = ApiRequestStatus.OKAY;
/**
* The cached value of the '{@link #getStatus() Status}' attribute.
*
*
* @see #getStatus()
* @generated
* @ordered
*/
protected ApiRequestStatus status = STATUS_EDEFAULT;
/**
*
*
* @generated
*/
protected ApiRequestImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return ComponentPackage.Literals.API_REQUEST;
}
/**
*
*
* @generated
*/
public String getComponentName() {
return componentName;
}
/**
*
*
* @generated
*/
public void setComponentName(String newComponentName) {
String oldComponentName = componentName;
componentName = newComponentName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.API_REQUEST__COMPONENT_NAME, oldComponentName, componentName));
}
/**
*
*
* @generated
*/
public String getResourcePath() {
return resourcePath;
}
/**
*
*
* @generated
*/
public void setResourcePath(String newResourcePath) {
String oldResourcePath = resourcePath;
resourcePath = newResourcePath;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.API_REQUEST__RESOURCE_PATH, oldResourcePath, resourcePath));
}
/**
*
*
* @generated
*/
public String getTransactionId() {
return transactionId;
}
/**
*
*
* @generated
*/
public void setTransactionId(String newTransactionId) {
String oldTransactionId = transactionId;
transactionId = newTransactionId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.API_REQUEST__TRANSACTION_ID, oldTransactionId, transactionId));
}
/**
*
*
* @generated
*/
public String getParentTransactionId() {
return parentTransactionId;
}
/**
*
*
* @generated
*/
public void setParentTransactionId(String newParentTransactionId) {
String oldParentTransactionId = parentTransactionId;
parentTransactionId = newParentTransactionId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.API_REQUEST__PARENT_TRANSACTION_ID, oldParentTransactionId, parentTransactionId));
}
/**
*
*
* @generated
*/
public String getAction() {
return action;
}
/**
*
*
* @generated
*/
public void setAction(String newAction) {
String oldAction = action;
action = newAction;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.API_REQUEST__ACTION, oldAction, action));
}
/**
*
*
* @generated
*/
public Long getDuration() {
return duration;
}
/**
*
*
* @generated
*/
public void setDuration(Long newDuration) {
Long oldDuration = duration;
duration = newDuration;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.API_REQUEST__DURATION, oldDuration, duration));
}
/**
*
*
* @generated
*/
public ApiRequestStatus getStatus() {
return status;
}
/**
*
*
* @generated
*/
public void setStatus(ApiRequestStatus newStatus) {
ApiRequestStatus oldStatus = status;
status = newStatus == null ? STATUS_EDEFAULT : newStatus;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ComponentPackage.API_REQUEST__STATUS, oldStatus, status));
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ComponentPackage.API_REQUEST__COMPONENT_NAME:
return getComponentName();
case ComponentPackage.API_REQUEST__RESOURCE_PATH:
return getResourcePath();
case ComponentPackage.API_REQUEST__TRANSACTION_ID:
return getTransactionId();
case ComponentPackage.API_REQUEST__PARENT_TRANSACTION_ID:
return getParentTransactionId();
case ComponentPackage.API_REQUEST__ACTION:
return getAction();
case ComponentPackage.API_REQUEST__DURATION:
return getDuration();
case ComponentPackage.API_REQUEST__STATUS:
return getStatus();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ComponentPackage.API_REQUEST__COMPONENT_NAME:
setComponentName((String)newValue);
return;
case ComponentPackage.API_REQUEST__RESOURCE_PATH:
setResourcePath((String)newValue);
return;
case ComponentPackage.API_REQUEST__TRANSACTION_ID:
setTransactionId((String)newValue);
return;
case ComponentPackage.API_REQUEST__PARENT_TRANSACTION_ID:
setParentTransactionId((String)newValue);
return;
case ComponentPackage.API_REQUEST__ACTION:
setAction((String)newValue);
return;
case ComponentPackage.API_REQUEST__DURATION:
setDuration((Long)newValue);
return;
case ComponentPackage.API_REQUEST__STATUS:
setStatus((ApiRequestStatus)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ComponentPackage.API_REQUEST__COMPONENT_NAME:
setComponentName(COMPONENT_NAME_EDEFAULT);
return;
case ComponentPackage.API_REQUEST__RESOURCE_PATH:
setResourcePath(RESOURCE_PATH_EDEFAULT);
return;
case ComponentPackage.API_REQUEST__TRANSACTION_ID:
setTransactionId(TRANSACTION_ID_EDEFAULT);
return;
case ComponentPackage.API_REQUEST__PARENT_TRANSACTION_ID:
setParentTransactionId(PARENT_TRANSACTION_ID_EDEFAULT);
return;
case ComponentPackage.API_REQUEST__ACTION:
setAction(ACTION_EDEFAULT);
return;
case ComponentPackage.API_REQUEST__DURATION:
setDuration(DURATION_EDEFAULT);
return;
case ComponentPackage.API_REQUEST__STATUS:
setStatus(STATUS_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ComponentPackage.API_REQUEST__COMPONENT_NAME:
return COMPONENT_NAME_EDEFAULT == null ? componentName != null : !COMPONENT_NAME_EDEFAULT.equals(componentName);
case ComponentPackage.API_REQUEST__RESOURCE_PATH:
return RESOURCE_PATH_EDEFAULT == null ? resourcePath != null : !RESOURCE_PATH_EDEFAULT.equals(resourcePath);
case ComponentPackage.API_REQUEST__TRANSACTION_ID:
return TRANSACTION_ID_EDEFAULT == null ? transactionId != null : !TRANSACTION_ID_EDEFAULT.equals(transactionId);
case ComponentPackage.API_REQUEST__PARENT_TRANSACTION_ID:
return PARENT_TRANSACTION_ID_EDEFAULT == null ? parentTransactionId != null : !PARENT_TRANSACTION_ID_EDEFAULT.equals(parentTransactionId);
case ComponentPackage.API_REQUEST__ACTION:
return ACTION_EDEFAULT == null ? action != null : !ACTION_EDEFAULT.equals(action);
case ComponentPackage.API_REQUEST__DURATION:
return DURATION_EDEFAULT == null ? duration != null : !DURATION_EDEFAULT.equals(duration);
case ComponentPackage.API_REQUEST__STATUS:
return status != STATUS_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (componentName: ");
result.append(componentName);
result.append(", resourcePath: ");
result.append(resourcePath);
result.append(", transactionId: ");
result.append(transactionId);
result.append(", parentTransactionId: ");
result.append(parentTransactionId);
result.append(", action: ");
result.append(action);
result.append(", duration: ");
result.append(duration);
result.append(", status: ");
result.append(status);
result.append(')');
return result.toString();
}
} //ApiRequestImpl