blob: 03a74409a7b83b2e5f74c2d4c4143c1e8477a6a9 [file] [log] [blame]
/**
* *******************************************************************************
* Copyright (c) 2015-2021 Robert Bosch GmbH and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Generated using Eclipse EMF
*
* *******************************************************************************
*/
package org.eclipse.app4mc.amalthea.model.impl;
import org.eclipse.app4mc.amalthea.model.AmaltheaPackage;
import org.eclipse.app4mc.amalthea.model.OrderPrecedenceSpec;
import org.eclipse.app4mc.amalthea.model.OrderType;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Order Precedence Spec</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.app4mc.amalthea.model.impl.OrderPrecedenceSpecImpl#getOrderType <em>Order Type</em>}</li>
* </ul>
*
* @generated
*/
public class OrderPrecedenceSpecImpl extends GeneralPrecedenceImpl implements OrderPrecedenceSpec {
/**
* The default value of the '{@link #getOrderType() <em>Order Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOrderType()
* @generated
* @ordered
*/
protected static final OrderType ORDER_TYPE_EDEFAULT = OrderType._UNDEFINED_;
/**
* The cached value of the '{@link #getOrderType() <em>Order Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOrderType()
* @generated
* @ordered
*/
protected OrderType orderType = ORDER_TYPE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected OrderPrecedenceSpecImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return AmaltheaPackage.eINSTANCE.getOrderPrecedenceSpec();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public OrderType getOrderType() {
return orderType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setOrderType(OrderType newOrderType) {
OrderType oldOrderType = orderType;
orderType = newOrderType == null ? ORDER_TYPE_EDEFAULT : newOrderType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AmaltheaPackage.ORDER_PRECEDENCE_SPEC__ORDER_TYPE, oldOrderType, orderType));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case AmaltheaPackage.ORDER_PRECEDENCE_SPEC__ORDER_TYPE:
return getOrderType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AmaltheaPackage.ORDER_PRECEDENCE_SPEC__ORDER_TYPE:
setOrderType((OrderType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case AmaltheaPackage.ORDER_PRECEDENCE_SPEC__ORDER_TYPE:
setOrderType(ORDER_TYPE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AmaltheaPackage.ORDER_PRECEDENCE_SPEC__ORDER_TYPE:
return orderType != ORDER_TYPE_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
result.append(" (orderType: ");
result.append(orderType);
result.append(')');
return result.toString();
}
} //OrderPrecedenceSpecImpl