| /******************************************************************************* |
| * Copyright (c) 2009, 2019 Xored Software Inc and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * Xored Software Inc - initial API and implementation and/or initial documentation |
| *******************************************************************************/ |
| package org.eclipse.rcptt.tesla.core.protocol.impl; |
| |
| import org.eclipse.rcptt.tesla.core.protocol.GetColorResponse; |
| import org.eclipse.rcptt.tesla.core.protocol.ProtocolPackage; |
| |
| import org.eclipse.rcptt.tesla.core.protocol.raw.impl.ResponseImpl; |
| |
| 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>Get Color Response</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.tesla.core.protocol.impl.GetColorResponseImpl#getColor <em>Color</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class GetColorResponseImpl extends ResponseImpl implements GetColorResponse { |
| /** |
| * The default value of the '{@link #getColor() <em>Color</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getColor() |
| * @generated |
| * @ordered |
| */ |
| protected static final String COLOR_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getColor() <em>Color</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getColor() |
| * @generated |
| * @ordered |
| */ |
| protected String color = COLOR_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected GetColorResponseImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ProtocolPackage.Literals.GET_COLOR_RESPONSE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getColor() { |
| return color; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setColor(String newColor) { |
| String oldColor = color; |
| color = newColor; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ProtocolPackage.GET_COLOR_RESPONSE__COLOR, oldColor, color)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ProtocolPackage.GET_COLOR_RESPONSE__COLOR: |
| return getColor(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ProtocolPackage.GET_COLOR_RESPONSE__COLOR: |
| setColor((String)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ProtocolPackage.GET_COLOR_RESPONSE__COLOR: |
| setColor(COLOR_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ProtocolPackage.GET_COLOR_RESPONSE__COLOR: |
| return COLOR_EDEFAULT == null ? color != null : !COLOR_EDEFAULT.equals(color); |
| } |
| 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(" (color: "); |
| result.append(color); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //GetColorResponseImpl |