blob: fa2a15bd6a21a1453ef8c870e85ecbed3f2ffcc3 [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.core.common.model.binding.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.osbp.ecview.core.common.model.binding.BindingPackage;
import org.eclipse.osbp.ecview.core.common.model.binding.YEnumListBindingEndpoint;
import org.eclipse.osbp.ecview.core.common.model.core.YElement;
// TODO: Auto-generated Javadoc
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>YEnum List Binding Endpoint</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.ecview.core.common.model.binding.impl.YEnumListBindingEndpointImpl#getEnum <em>Enum</em>}</li>
* </ul>
*
* @generated
*/
public class YEnumListBindingEndpointImpl extends YListBindingEndpointImpl implements YEnumListBindingEndpoint {
/**
* The cached value of the '{@link #getEnum() <em>Enum</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getEnum()
* @generated
* @ordered
*/
protected Class<?> enum_;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->.
*
* @generated
*/
protected YEnumListBindingEndpointImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->.
*
* @return the e class
* @generated
*/
@Override
protected EClass eStaticClass() {
return BindingPackage.Literals.YENUM_LIST_BINDING_ENDPOINT;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->.
*
* @return the enum
* @generated
*/
public Class<?> getEnum() {
return enum_;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->.
*
* @param newEnum
* the new enum
* @generated
*/
public void setEnum(Class<?> newEnum) {
Class<?> oldEnum = enum_;
enum_ = newEnum;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, BindingPackage.YENUM_LIST_BINDING_ENDPOINT__ENUM, oldEnum, enum_));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->.
*
* @param featureID
* the feature id
* @param resolve
* the resolve
* @param coreType
* the core type
* @return the object
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case BindingPackage.YENUM_LIST_BINDING_ENDPOINT__ENUM:
return getEnum();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->.
*
* @param featureID
* the feature id
* @param newValue
* the new value
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BindingPackage.YENUM_LIST_BINDING_ENDPOINT__ENUM:
setEnum((Class<?>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->.
*
* @param featureID
* the feature id
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BindingPackage.YENUM_LIST_BINDING_ENDPOINT__ENUM:
setEnum((Class<?>)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->.
*
* @param featureID
* the feature id
* @return true, if successful
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BindingPackage.YENUM_LIST_BINDING_ENDPOINT__ENUM:
return enum_ != null;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->.
*
* @return the string
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (enum: ");
result.append(enum_);
result.append(')');
return result.toString();
}
/* (non-Javadoc)
* @see org.eclipse.osbp.ecview.core.common.model.binding.impl.YBindingEndpointImpl#isBindsElement(org.eclipse.osbp.ecview.core.common.model.core.YElement)
*/
@Override
public boolean isBindsElement(YElement element) {
return false;
}
} //YEnumListBindingEndpointImpl