/** * <copyright> Copyright (c) 2008-2009 Jonas Helming, Maximilian Koegel. 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 </copyright> * * * */ package org.eclipse.emf.emfstore.server.model.operation.impl; import java.util.Collection; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.util.EObjectResolvingEList; import org.eclipse.emf.emfstore.common.model.EMFStoreProperty; import org.eclipse.emf.emfstore.server.model.operation.OperationPackage; import org.eclipse.emf.emfstore.server.model.operation.WritePropertiesOperation; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Write Properties Operation</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.emf.emfstore.server.model.operation.impl.WritePropertiesOperationImpl#getProperties <em>Properties</em>}</li> * </ul> * </p> * * @generated */ public class WritePropertiesOperationImpl extends ProjectOperationImpl<Void> implements WritePropertiesOperation { /** * The cached value of the '{@link #getProperties() <em>Properties</em>}' reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getProperties() * @generated * @ordered */ protected EList<EMFStoreProperty> properties; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected WritePropertiesOperationImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return OperationPackage.Literals.WRITE_PROPERTIES_OPERATION; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<EMFStoreProperty> getProperties() { if (properties == null) { properties = new EObjectResolvingEList<EMFStoreProperty>(EMFStoreProperty.class, this, OperationPackage.WRITE_PROPERTIES_OPERATION__PROPERTIES); } return properties; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case OperationPackage.WRITE_PROPERTIES_OPERATION__PROPERTIES: return getProperties(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case OperationPackage.WRITE_PROPERTIES_OPERATION__PROPERTIES: getProperties().clear(); getProperties().addAll((Collection<? extends EMFStoreProperty>)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case OperationPackage.WRITE_PROPERTIES_OPERATION__PROPERTIES: getProperties().clear(); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case OperationPackage.WRITE_PROPERTIES_OPERATION__PROPERTIES: return properties != null && !properties.isEmpty(); } return super.eIsSet(featureID); } } //WritePropertiesOperationImpl