blob: bad7ae3e58e7fdb31190e0003c9c2be627c3a23e [file] [log] [blame]
/**
* Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Florian Pirchner - Initial implementation
*/
package org.eclipse.osbp.ecview.semantic.uimodel.impl;
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;
import org.eclipse.osbp.ecview.semantic.uimodel.UiErrorCode;
import org.eclipse.osbp.ecview.semantic.uimodel.UiModelPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Ui Error Code</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.ecview.semantic.uimodel.impl.UiErrorCodeImpl#getId <em>Id</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.semantic.uimodel.impl.UiErrorCodeImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.semantic.uimodel.impl.UiErrorCodeImpl#getDefaultMessage <em>Default Message</em>}</li>
* </ul>
*
* @generated
*/
public class UiErrorCodeImpl extends MinimalEObjectImpl.Container implements UiErrorCode {
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected String id = ID_EDEFAULT;
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The default value of the '{@link #getDefaultMessage() <em>Default Message</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDefaultMessage()
* @generated
* @ordered
*/
protected static final String DEFAULT_MESSAGE_EDEFAULT = null;
/**
* The cached value of the '{@link #getDefaultMessage() <em>Default Message</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDefaultMessage()
* @generated
* @ordered
*/
protected String defaultMessage = DEFAULT_MESSAGE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected UiErrorCodeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return UiModelPackage.Literals.UI_ERROR_CODE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getId() {
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setId(String newId) {
String oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_ERROR_CODE__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_ERROR_CODE__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getDefaultMessage() {
return defaultMessage;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDefaultMessage(String newDefaultMessage) {
String oldDefaultMessage = defaultMessage;
defaultMessage = newDefaultMessage;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, UiModelPackage.UI_ERROR_CODE__DEFAULT_MESSAGE, oldDefaultMessage, defaultMessage));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case UiModelPackage.UI_ERROR_CODE__ID:
return getId();
case UiModelPackage.UI_ERROR_CODE__NAME:
return getName();
case UiModelPackage.UI_ERROR_CODE__DEFAULT_MESSAGE:
return getDefaultMessage();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case UiModelPackage.UI_ERROR_CODE__ID:
setId((String)newValue);
return;
case UiModelPackage.UI_ERROR_CODE__NAME:
setName((String)newValue);
return;
case UiModelPackage.UI_ERROR_CODE__DEFAULT_MESSAGE:
setDefaultMessage((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case UiModelPackage.UI_ERROR_CODE__ID:
setId(ID_EDEFAULT);
return;
case UiModelPackage.UI_ERROR_CODE__NAME:
setName(NAME_EDEFAULT);
return;
case UiModelPackage.UI_ERROR_CODE__DEFAULT_MESSAGE:
setDefaultMessage(DEFAULT_MESSAGE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case UiModelPackage.UI_ERROR_CODE__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case UiModelPackage.UI_ERROR_CODE__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case UiModelPackage.UI_ERROR_CODE__DEFAULT_MESSAGE:
return DEFAULT_MESSAGE_EDEFAULT == null ? defaultMessage != null : !DEFAULT_MESSAGE_EDEFAULT.equals(defaultMessage);
}
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(" (id: ");
result.append(id);
result.append(", name: ");
result.append(name);
result.append(", defaultMessage: ");
result.append(defaultMessage);
result.append(')');
return result.toString();
}
} //UiErrorCodeImpl