/*- * ============LICENSE_START========================================== * OPENECOMP - DCAE * =================================================================== * Copyright (c) 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ============LICENSE_END============================================ */ /** */ package org.openecomp.ncomp.openstack.neutron.impl; import org.openecomp.ncomp.openstack.neutron.CreatePortRequest; import org.openecomp.ncomp.openstack.neutron.FixedIp; import org.openecomp.ncomp.openstack.neutron.NeutronPackage; import java.util.Collection; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; /** * * An implementation of the model object 'Create Port Request'. * *

* The following features are implemented: *

* * * @generated */ public class CreatePortRequestImpl extends NeutronRequestImpl implements CreatePortRequest { /** * The default value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() Name}' attribute. * * * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * The default value of the '{@link #getBindingVnicType() Binding Vnic Type}' attribute. * * * @see #getBindingVnicType() * @generated * @ordered */ protected static final String BINDING_VNIC_TYPE_EDEFAULT = null; /** * The cached value of the '{@link #getBindingVnicType() Binding Vnic Type}' attribute. * * * @see #getBindingVnicType() * @generated * @ordered */ protected String bindingVnicType = BINDING_VNIC_TYPE_EDEFAULT; /** * The default value of the '{@link #getStatus() Status}' attribute. * * * @see #getStatus() * @generated * @ordered */ protected static final String STATUS_EDEFAULT = null; /** * The cached value of the '{@link #getStatus() Status}' attribute. * * * @see #getStatus() * @generated * @ordered */ protected String status = STATUS_EDEFAULT; /** * The default value of the '{@link #getAdmin_state_up() Admin state up}' attribute. * * * @see #getAdmin_state_up() * @generated * @ordered */ protected static final Boolean ADMIN_STATE_UP_EDEFAULT = null; /** * The cached value of the '{@link #getAdmin_state_up() Admin state up}' attribute. * * * @see #getAdmin_state_up() * @generated * @ordered */ protected Boolean admin_state_up = ADMIN_STATE_UP_EDEFAULT; /** * The cached value of the '{@link #getFixed_ips() Fixed ips}' containment reference list. * * * @see #getFixed_ips() * @generated * @ordered */ protected EList fixed_ips; /** * The default value of the '{@link #getMac_address() Mac address}' attribute. * * * @see #getMac_address() * @generated * @ordered */ protected static final String MAC_ADDRESS_EDEFAULT = null; /** * The cached value of the '{@link #getMac_address() Mac address}' attribute. * * * @see #getMac_address() * @generated * @ordered */ protected String mac_address = MAC_ADDRESS_EDEFAULT; /** * The default value of the '{@link #getNetwork_id() Network id}' attribute. * * * @see #getNetwork_id() * @generated * @ordered */ protected static final String NETWORK_ID_EDEFAULT = null; /** * The cached value of the '{@link #getNetwork_id() Network id}' attribute. * * * @see #getNetwork_id() * @generated * @ordered */ protected String network_id = NETWORK_ID_EDEFAULT; /** * * * @generated */ protected CreatePortRequestImpl() { super(); } /** * * * @generated */ @Override protected EClass eStaticClass() { return NeutronPackage.Literals.CREATE_PORT_REQUEST; } /** * * * @generated */ public String getName() { return name; } /** * * * @generated */ public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, NeutronPackage.CREATE_PORT_REQUEST__NAME, oldName, name)); } /** * * * @generated */ public String getBindingVnicType() { return bindingVnicType; } /** * * * @generated */ public void setBindingVnicType(String newBindingVnicType) { String oldBindingVnicType = bindingVnicType; bindingVnicType = newBindingVnicType; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, NeutronPackage.CREATE_PORT_REQUEST__BINDING_VNIC_TYPE, oldBindingVnicType, bindingVnicType)); } /** * * * @generated */ public String getStatus() { return status; } /** * * * @generated */ public void setStatus(String newStatus) { String oldStatus = status; status = newStatus; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, NeutronPackage.CREATE_PORT_REQUEST__STATUS, oldStatus, status)); } /** * * * @generated */ public Boolean getAdmin_state_up() { return admin_state_up; } /** * * * @generated */ public void setAdmin_state_up(Boolean newAdmin_state_up) { Boolean oldAdmin_state_up = admin_state_up; admin_state_up = newAdmin_state_up; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, NeutronPackage.CREATE_PORT_REQUEST__ADMIN_STATE_UP, oldAdmin_state_up, admin_state_up)); } /** * * * @generated */ public EList getFixed_ips() { if (fixed_ips == null) { fixed_ips = new EObjectContainmentEList(FixedIp.class, this, NeutronPackage.CREATE_PORT_REQUEST__FIXED_IPS); } return fixed_ips; } /** * * * @generated */ public String getMac_address() { return mac_address; } /** * * * @generated */ public void setMac_address(String newMac_address) { String oldMac_address = mac_address; mac_address = newMac_address; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, NeutronPackage.CREATE_PORT_REQUEST__MAC_ADDRESS, oldMac_address, mac_address)); } /** * * * @generated */ public String getNetwork_id() { return network_id; } /** * * * @generated */ public void setNetwork_id(String newNetwork_id) { String oldNetwork_id = network_id; network_id = newNetwork_id; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, NeutronPackage.CREATE_PORT_REQUEST__NETWORK_ID, oldNetwork_id, network_id)); } /** * * * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case NeutronPackage.CREATE_PORT_REQUEST__FIXED_IPS: return ((InternalEList)getFixed_ips()).basicRemove(otherEnd, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } /** * * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case NeutronPackage.CREATE_PORT_REQUEST__NAME: return getName(); case NeutronPackage.CREATE_PORT_REQUEST__BINDING_VNIC_TYPE: return getBindingVnicType(); case NeutronPackage.CREATE_PORT_REQUEST__STATUS: return getStatus(); case NeutronPackage.CREATE_PORT_REQUEST__ADMIN_STATE_UP: return getAdmin_state_up(); case NeutronPackage.CREATE_PORT_REQUEST__FIXED_IPS: return getFixed_ips(); case NeutronPackage.CREATE_PORT_REQUEST__MAC_ADDRESS: return getMac_address(); case NeutronPackage.CREATE_PORT_REQUEST__NETWORK_ID: return getNetwork_id(); } return super.eGet(featureID, resolve, coreType); } /** * * * @generated */ @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case NeutronPackage.CREATE_PORT_REQUEST__NAME: setName((String)newValue); return; case NeutronPackage.CREATE_PORT_REQUEST__BINDING_VNIC_TYPE: setBindingVnicType((String)newValue); return; case NeutronPackage.CREATE_PORT_REQUEST__STATUS: setStatus((String)newValue); return; case NeutronPackage.CREATE_PORT_REQUEST__ADMIN_STATE_UP: setAdmin_state_up((Boolean)newValue); return; case NeutronPackage.CREATE_PORT_REQUEST__FIXED_IPS: getFixed_ips().clear(); getFixed_ips().addAll((Collection)newValue); return; case NeutronPackage.CREATE_PORT_REQUEST__MAC_ADDRESS: setMac_address((String)newValue); return; case NeutronPackage.CREATE_PORT_REQUEST__NETWORK_ID: setNetwork_id((String)newValue); return; } super.eSet(featureID, newValue); } /** * * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case NeutronPackage.CREATE_PORT_REQUEST__NAME: setName(NAME_EDEFAULT); return; case NeutronPackage.CREATE_PORT_REQUEST__BINDING_VNIC_TYPE: setBindingVnicType(BINDING_VNIC_TYPE_EDEFAULT); return; case NeutronPackage.CREATE_PORT_REQUEST__STATUS: setStatus(STATUS_EDEFAULT); return; case NeutronPackage.CREATE_PORT_REQUEST__ADMIN_STATE_UP: setAdmin_state_up(ADMIN_STATE_UP_EDEFAULT); return; case NeutronPackage.CREATE_PORT_REQUEST__FIXED_IPS: getFixed_ips().clear(); return; case NeutronPackage.CREATE_PORT_REQUEST__MAC_ADDRESS: setMac_address(MAC_ADDRESS_EDEFAULT); return; case NeutronPackage.CREATE_PORT_REQUEST__NETWORK_ID: setNetwork_id(NETWORK_ID_EDEFAULT); return; } super.eUnset(featureID); } /** * * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case NeutronPackage.CREATE_PORT_REQUEST__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case NeutronPackage.CREATE_PORT_REQUEST__BINDING_VNIC_TYPE: return BINDING_VNIC_TYPE_EDEFAULT == null ? bindingVnicType != null : !BINDING_VNIC_TYPE_EDEFAULT.equals(bindingVnicType); case NeutronPackage.CREATE_PORT_REQUEST__STATUS: return STATUS_EDEFAULT == null ? status != null : !STATUS_EDEFAULT.equals(status); case NeutronPackage.CREATE_PORT_REQUEST__ADMIN_STATE_UP: return ADMIN_STATE_UP_EDEFAULT == null ? admin_state_up != null : !ADMIN_STATE_UP_EDEFAULT.equals(admin_state_up); case NeutronPackage.CREATE_PORT_REQUEST__FIXED_IPS: return fixed_ips != null && !fixed_ips.isEmpty(); case NeutronPackage.CREATE_PORT_REQUEST__MAC_ADDRESS: return MAC_ADDRESS_EDEFAULT == null ? mac_address != null : !MAC_ADDRESS_EDEFAULT.equals(mac_address); case NeutronPackage.CREATE_PORT_REQUEST__NETWORK_ID: return NETWORK_ID_EDEFAULT == null ? network_id != null : !NETWORK_ID_EDEFAULT.equals(network_id); } return super.eIsSet(featureID); } /** * * * @generated */ @Override public String toString() { if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); result.append(" (name: "); result.append(name); result.append(", bindingVnicType: "); result.append(bindingVnicType); result.append(", status: "); result.append(status); result.append(", admin_state_up: "); result.append(admin_state_up); result.append(", mac_address: "); result.append(mac_address); result.append(", network_id: "); result.append(network_id); result.append(')'); return result.toString(); } } //CreatePortRequestImpl