| /******************************************************************************* |
| * Copyright (c) 2014 Bosch Software Innovations GmbH and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * and Eclipse Distribution License v1.0 which accompany this distribution. |
| * |
| * The Eclipse Public License is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * The Eclipse Distribution License is available at |
| * http://www.eclipse.org/org/documents/edl-v10.php. |
| * |
| * Contributors: |
| * Bosch Software Innovations GmbH - Please refer to git log |
| * |
| *******************************************************************************/ |
| /** |
| */ |
| package org.eclipse.vorto.functionblock.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.vorto.functionblock.FunctionblockPackage; |
| import org.eclipse.vorto.functionblock.PrimitiveType; |
| import org.eclipse.vorto.functionblock.ReturnPrimitiveType; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Return Primitive Type</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.vorto.functionblock.impl.ReturnPrimitiveTypeImpl#getReturnType <em>Return Type</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class ReturnPrimitiveTypeImpl extends ReturnTypeImpl implements ReturnPrimitiveType { |
| /** |
| * The default value of the '{@link #getReturnType() <em>Return Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getReturnType() |
| * @generated |
| * @ordered |
| */ |
| protected static final PrimitiveType RETURN_TYPE_EDEFAULT = PrimitiveType.STRING; |
| |
| /** |
| * The cached value of the '{@link #getReturnType() <em>Return Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getReturnType() |
| * @generated |
| * @ordered |
| */ |
| protected PrimitiveType returnType = RETURN_TYPE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ReturnPrimitiveTypeImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return FunctionblockPackage.Literals.RETURN_PRIMITIVE_TYPE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public PrimitiveType getReturnType() { |
| return returnType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setReturnType(PrimitiveType newReturnType) { |
| PrimitiveType oldReturnType = returnType; |
| returnType = newReturnType == null ? RETURN_TYPE_EDEFAULT : newReturnType; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, FunctionblockPackage.RETURN_PRIMITIVE_TYPE__RETURN_TYPE, oldReturnType, returnType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case FunctionblockPackage.RETURN_PRIMITIVE_TYPE__RETURN_TYPE: |
| return getReturnType(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case FunctionblockPackage.RETURN_PRIMITIVE_TYPE__RETURN_TYPE: |
| setReturnType((PrimitiveType)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case FunctionblockPackage.RETURN_PRIMITIVE_TYPE__RETURN_TYPE: |
| setReturnType(RETURN_TYPE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case FunctionblockPackage.RETURN_PRIMITIVE_TYPE__RETURN_TYPE: |
| return returnType != RETURN_TYPE_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (returnType: "); |
| result.append(returnType); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ReturnPrimitiveTypeImpl |