/*******************************************************************************
* Copyright (C) 2013, University of Patras, Greece* 
*
* 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
*******************************************************************************/
package gr.upatras.ece.nam.broker.model.users;

import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import gr.upatras.ece.nam.broker.model.federationscenarios.RequestedFederationScenario;

/**
 * A representation of the model object '<em><b>TestbedDesigner</b></em>'. <!--
 * begin-user-doc --> <!-- end-user-doc -->
 * 
 * @generated
 */
@Entity(name = "TestbedDesigner")
public class TestbedDesigner extends BrokerUser {

	/**
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @generated
	 */
	@ManyToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH })
	private List<RequestedFederationScenario> designsVirtualTestbeds = new ArrayList<RequestedFederationScenario>();

	/**
	 * Returns the value of '<em><b>designsVirtualTestbeds</b></em>' feature.
	 * 
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @return the value of '<em><b>designsVirtualTestbeds</b></em>' feature
	 * @generated
	 */
	public List<RequestedFederationScenario> getDesignsVirtualTestbeds() {
		return designsVirtualTestbeds;
	}

	/**
	 * Adds to the <em>designsVirtualTestbeds</em> feature.
	 * 
	 * @param designsVirtualTestbedsValue
	 *            the value to add
	 * 
	 * @generated
	 */
	public void addToDesignsVirtualTestbeds(RequestedFederationScenario designsVirtualTestbedsValue) {
		if (!designsVirtualTestbeds.contains(designsVirtualTestbedsValue)) {
			designsVirtualTestbeds.add(designsVirtualTestbedsValue);
		}
	}

	/**
	 * Removes from the <em>designsVirtualTestbeds</em> feature.
	 * 
	 * @param designsVirtualTestbedsValue
	 *            the value to remove
	 * 
	 * @generated
	 */
	public void removeFromDesignsVirtualTestbeds(RequestedFederationScenario designsVirtualTestbedsValue) {
		if (designsVirtualTestbeds.contains(designsVirtualTestbedsValue)) {
			designsVirtualTestbeds.remove(designsVirtualTestbedsValue);
		}
	}

	/**
	 * Clears the <em>designsVirtualTestbeds</em> feature.
	 * 
	 * @generated
	 */
	public void clearDesignsVirtualTestbeds() {
		while (!designsVirtualTestbeds.isEmpty()) {
			removeFromDesignsVirtualTestbeds(designsVirtualTestbeds.iterator().next());
		}
	}

	/**
	 * Sets the '{@link TestbedDesigner#getDesignsVirtualTestbeds()
	 * <em>designsVirtualTestbeds</em>}' feature.
	 * 
	 * <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @param newDesignsVirtualTestbeds
	 *            the new value of the '
	 *            {@link TestbedDesigner#getDesignsVirtualTestbeds()
	 *            designsVirtualTestbeds}' feature.
	 * @generated
	 */
	public void setDesignsVirtualTestbeds(List<RequestedFederationScenario> newDesignsVirtualTestbeds) {
		designsVirtualTestbeds = newDesignsVirtualTestbeds;
	}

	/**
	 * A toString method which prints the values of all EAttributes of this
	 * instance. <!-- begin-user-doc --> <!-- end-user-doc -->
	 * 
	 * @generated
	 */
	@Override
	public String toString() {
		return "TestbedDesigner ";
	}
}
