blob: c3050c6a82b8daa3d62a926e439a5c8e2c24f976 [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.IdTypeType1;
import io.shell.admin.aas._1._0.IdentificationT;
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>Identification T</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link io.shell.admin.aas._1._0.impl.IdentificationTImpl#getValue <em>Value</em>}</li>
* <li>{@link io.shell.admin.aas._1._0.impl.IdentificationTImpl#getIdType <em>Id Type</em>}</li>
* </ul>
*
* @generated
*/
public class IdentificationTImpl extends MinimalEObjectImpl.Container implements IdentificationT {
/**
* 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 IdTypeType1 ID_TYPE_EDEFAULT = IdTypeType1.URI;
/**
* The cached value of the '{@link #getIdType() <em>Id Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getIdType()
* @generated
* @ordered
*/
protected IdTypeType1 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;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected IdentificationTImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return _0Package.Literals.IDENTIFICATION_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.IDENTIFICATION_T__VALUE, oldValue, value));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public IdTypeType1 getIdType() {
return idType;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setIdType(IdTypeType1 newIdType) {
IdTypeType1 oldIdType = idType;
idType = newIdType == null ? ID_TYPE_EDEFAULT : newIdType;
boolean oldIdTypeESet = idTypeESet;
idTypeESet = true;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, _0Package.IDENTIFICATION_T__ID_TYPE, oldIdType, idType, !oldIdTypeESet));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void unsetIdType() {
IdTypeType1 oldIdType = idType;
boolean oldIdTypeESet = idTypeESet;
idType = ID_TYPE_EDEFAULT;
idTypeESet = false;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.UNSET, _0Package.IDENTIFICATION_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
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case _0Package.IDENTIFICATION_T__VALUE:
return getValue();
case _0Package.IDENTIFICATION_T__ID_TYPE:
return getIdType();
}
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.IDENTIFICATION_T__VALUE:
setValue((String)newValue);
return;
case _0Package.IDENTIFICATION_T__ID_TYPE:
setIdType((IdTypeType1)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case _0Package.IDENTIFICATION_T__VALUE:
setValue(VALUE_EDEFAULT);
return;
case _0Package.IDENTIFICATION_T__ID_TYPE:
unsetIdType();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case _0Package.IDENTIFICATION_T__VALUE:
return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
case _0Package.IDENTIFICATION_T__ID_TYPE:
return isSetIdType();
}
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(')');
return result.toString();
}
} //IdentificationTImpl