blob: 7fdf6f90a2687da43e70bf61edb072d67ce93367 [file] [log] [blame]
/*****************************************************************************
* Copyright (c) 2013, 2014 CEA LIST.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
*****************************************************************************/
package org.eclipse.papyrus.interoperability.rsa.default_.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.papyrus.interoperability.rsa.default_.DefaultPackage;
import org.eclipse.papyrus.interoperability.rsa.default_.URL;
import org.eclipse.uml2.uml.Comment;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>URL</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.papyrus.interoperability.rsa.default_.impl.URLImpl#getBase_Comment <em>Base Comment</em>}</li>
* <li>{@link org.eclipse.papyrus.interoperability.rsa.default_.impl.URLImpl#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.papyrus.interoperability.rsa.default_.impl.URLImpl#getDisplayName <em>Display Name</em>}</li>
* <li>{@link org.eclipse.papyrus.interoperability.rsa.default_.impl.URLImpl#getIcon <em>Icon</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class URLImpl extends MinimalEObjectImpl.Container implements URL {
/**
* The cached value of the '{@link #getBase_Comment() <em>Base Comment</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getBase_Comment()
* @generated
* @ordered
*/
protected Comment base_Comment;
/**
* The default value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getType()
* @generated
* @ordered
*/
protected static final String TYPE_EDEFAULT = null;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getType()
* @generated
* @ordered
*/
protected String type = TYPE_EDEFAULT;
/**
* The default value of the '{@link #getDisplayName() <em>Display Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getDisplayName()
* @generated
* @ordered
*/
protected static final String DISPLAY_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getDisplayName() <em>Display Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getDisplayName()
* @generated
* @ordered
*/
protected String displayName = DISPLAY_NAME_EDEFAULT;
/**
* The default value of the '{@link #getIcon() <em>Icon</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getIcon()
* @generated
* @ordered
*/
protected static final byte[] ICON_EDEFAULT = null;
/**
* The cached value of the '{@link #getIcon() <em>Icon</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #getIcon()
* @generated
* @ordered
*/
protected byte[] icon = ICON_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
protected URLImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return DefaultPackage.Literals.URL;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public Comment getBase_Comment() {
if (base_Comment != null && base_Comment.eIsProxy()) {
InternalEObject oldBase_Comment = (InternalEObject) base_Comment;
base_Comment = (Comment) eResolveProxy(oldBase_Comment);
if (base_Comment != oldBase_Comment) {
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DefaultPackage.URL__BASE_COMMENT, oldBase_Comment, base_Comment));
}
}
}
return base_Comment;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
public Comment basicGetBase_Comment() {
return base_Comment;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setBase_Comment(Comment newBase_Comment) {
Comment oldBase_Comment = base_Comment;
base_Comment = newBase_Comment;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, DefaultPackage.URL__BASE_COMMENT, oldBase_Comment, base_Comment));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public String getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setType(String newType) {
String oldType = type;
type = newType;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, DefaultPackage.URL__TYPE, oldType, type));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public String getDisplayName() {
return displayName;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setDisplayName(String newDisplayName) {
String oldDisplayName = displayName;
displayName = newDisplayName;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, DefaultPackage.URL__DISPLAY_NAME, oldDisplayName, displayName));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public byte[] getIcon() {
return icon;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setIcon(byte[] newIcon) {
byte[] oldIcon = icon;
icon = newIcon;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, DefaultPackage.URL__ICON, oldIcon, icon));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DefaultPackage.URL__BASE_COMMENT:
if (resolve) {
return getBase_Comment();
}
return basicGetBase_Comment();
case DefaultPackage.URL__TYPE:
return getType();
case DefaultPackage.URL__DISPLAY_NAME:
return getDisplayName();
case DefaultPackage.URL__ICON:
return getIcon();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DefaultPackage.URL__BASE_COMMENT:
setBase_Comment((Comment) newValue);
return;
case DefaultPackage.URL__TYPE:
setType((String) newValue);
return;
case DefaultPackage.URL__DISPLAY_NAME:
setDisplayName((String) newValue);
return;
case DefaultPackage.URL__ICON:
setIcon((byte[]) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DefaultPackage.URL__BASE_COMMENT:
setBase_Comment((Comment) null);
return;
case DefaultPackage.URL__TYPE:
setType(TYPE_EDEFAULT);
return;
case DefaultPackage.URL__DISPLAY_NAME:
setDisplayName(DISPLAY_NAME_EDEFAULT);
return;
case DefaultPackage.URL__ICON:
setIcon(ICON_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DefaultPackage.URL__BASE_COMMENT:
return base_Comment != null;
case DefaultPackage.URL__TYPE:
return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
case DefaultPackage.URL__DISPLAY_NAME:
return DISPLAY_NAME_EDEFAULT == null ? displayName != null : !DISPLAY_NAME_EDEFAULT.equals(displayName);
case DefaultPackage.URL__ICON:
return ICON_EDEFAULT == null ? icon != null : !ICON_EDEFAULT.equals(icon);
}
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(" (type: ");
result.append(type);
result.append(", displayName: ");
result.append(displayName);
result.append(", icon: ");
result.append(icon);
result.append(')');
return result.toString();
}
} // URLImpl