blob: 62e05304f3afdf8af7e57d885ab8a34f7bd57f0e [file] [log] [blame]
/**
* ****************************************************************************
* Copyright (c) 2020 CEA LIST.
*
*
* 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:
* Asma Smaoui (CEA LIST) asma.smaoui@cea.fr - Initial API and implementation
*
* ****************************************************************************
*/
package io.shell.admin.aas._1._0.impl;
import io.shell.admin.aas._1._0.IdTypeType;
import io.shell.admin.aas._1._0.KeyT;
import io.shell.admin.aas._1._0.TypeType;
import io.shell.admin.aas._1._0._0Package;
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;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Key T</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link io.shell.admin.aas._1._0.impl.KeyTImpl#getValue <em>Value</em>}</li>
* <li>{@link io.shell.admin.aas._1._0.impl.KeyTImpl#getIdType <em>Id Type</em>}</li>
* <li>{@link io.shell.admin.aas._1._0.impl.KeyTImpl#isLocal <em>Local</em>}</li>
* <li>{@link io.shell.admin.aas._1._0.impl.KeyTImpl#getType <em>Type</em>}</li>
* </ul>
*
* @generated
*/
public class KeyTImpl extends MinimalEObjectImpl.Container implements KeyT {
/**
* The default value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected static final String VALUE_EDEFAULT = null;
/**
* The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getValue()
* @generated
* @ordered
*/
protected String value = VALUE_EDEFAULT;
/**
* The default value of the '{@link #getIdType() <em>Id Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIdType()
* @generated
* @ordered
*/
protected static final IdTypeType ID_TYPE_EDEFAULT = IdTypeType.ID_SHORT;
/**
* The cached value of the '{@link #getIdType() <em>Id Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIdType()
* @generated
* @ordered
*/
protected IdTypeType idType = ID_TYPE_EDEFAULT;
/**
* This is true if the Id Type attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean idTypeESet;
/**
* The default value of the '{@link #isLocal() <em>Local</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isLocal()
* @generated
* @ordered
*/
protected static final boolean LOCAL_EDEFAULT = false;
/**
* The cached value of the '{@link #isLocal() <em>Local</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isLocal()
* @generated
* @ordered
*/
protected boolean local = LOCAL_EDEFAULT;
/**
* This is true if the Local attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean localESet;
/**
* The default value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected static final TypeType TYPE_EDEFAULT = TypeType.GLOBAL_REFERENCE;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected TypeType type = TYPE_EDEFAULT;
/**
* This is true if the Type attribute has been set.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
protected boolean typeESet;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected KeyTImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return _0Package.Literals.KEY_T;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getValue() {
return value;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setValue(String newValue) {
String oldValue = value;
value = newValue;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, _0Package.KEY_T__VALUE, oldValue, value));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IdTypeType getIdType() {
return idType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIdType(IdTypeType newIdType) {
IdTypeType oldIdType = idType;
idType = newIdType == null ? ID_TYPE_EDEFAULT : newIdType;
boolean oldIdTypeESet = idTypeESet;
idTypeESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, _0Package.KEY_T__ID_TYPE, oldIdType, idType, !oldIdTypeESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetIdType() {
IdTypeType oldIdType = idType;
boolean oldIdTypeESet = idTypeESet;
idType = ID_TYPE_EDEFAULT;
idTypeESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, _0Package.KEY_T__ID_TYPE, oldIdType, ID_TYPE_EDEFAULT, oldIdTypeESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetIdType() {
return idTypeESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isLocal() {
return local;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setLocal(boolean newLocal) {
boolean oldLocal = local;
local = newLocal;
boolean oldLocalESet = localESet;
localESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, _0Package.KEY_T__LOCAL, oldLocal, local, !oldLocalESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetLocal() {
boolean oldLocal = local;
boolean oldLocalESet = localESet;
local = LOCAL_EDEFAULT;
localESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, _0Package.KEY_T__LOCAL, oldLocal, LOCAL_EDEFAULT, oldLocalESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetLocal() {
return localESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TypeType getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(TypeType newType) {
TypeType oldType = type;
type = newType == null ? TYPE_EDEFAULT : newType;
boolean oldTypeESet = typeESet;
typeESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, _0Package.KEY_T__TYPE, oldType, type, !oldTypeESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetType() {
TypeType oldType = type;
boolean oldTypeESet = typeESet;
type = TYPE_EDEFAULT;
typeESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, _0Package.KEY_T__TYPE, oldType, TYPE_EDEFAULT, oldTypeESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetType() {
return typeESet;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case _0Package.KEY_T__VALUE:
return getValue();
case _0Package.KEY_T__ID_TYPE:
return getIdType();
case _0Package.KEY_T__LOCAL:
return isLocal();
case _0Package.KEY_T__TYPE:
return getType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case _0Package.KEY_T__VALUE:
setValue((String)newValue);
return;
case _0Package.KEY_T__ID_TYPE:
setIdType((IdTypeType)newValue);
return;
case _0Package.KEY_T__LOCAL:
setLocal((Boolean)newValue);
return;
case _0Package.KEY_T__TYPE:
setType((TypeType)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case _0Package.KEY_T__VALUE:
setValue(VALUE_EDEFAULT);
return;
case _0Package.KEY_T__ID_TYPE:
unsetIdType();
return;
case _0Package.KEY_T__LOCAL:
unsetLocal();
return;
case _0Package.KEY_T__TYPE:
unsetType();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case _0Package.KEY_T__VALUE:
return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
case _0Package.KEY_T__ID_TYPE:
return isSetIdType();
case _0Package.KEY_T__LOCAL:
return isSetLocal();
case _0Package.KEY_T__TYPE:
return isSetType();
}
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(" (value: ");
result.append(value);
result.append(", idType: ");
if (idTypeESet) result.append(idType); else result.append("<unset>");
result.append(", local: ");
if (localESet) result.append(local); else result.append("<unset>");
result.append(", type: ");
if (typeESet) result.append(type); else result.append("<unset>");
result.append(')');
return result.toString();
}
} //KeyTImpl