2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.md.inventory.manager
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnector
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorUpdated
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowNodeConnector
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorBuilder
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowNode
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder
18 class InventoryMapping {
20 static def FlowCapableNodeConnector toInventoryAugment(FlowNodeConnector updated) {
21 if (updated instanceof FlowCapableNodeConnector) {
22 return updated as FlowCapableNodeConnector;
24 val it = new FlowCapableNodeConnectorBuilder();
25 advertisedFeatures = updated.advertisedFeatures
26 configuration = updated.configuration
27 currentFeature = updated.currentFeature
28 currentSpeed = updated.currentSpeed
29 hardwareAddress = updated.hardwareAddress
30 maximumSpeed = updated.maximumSpeed
32 peerFeatures = updated.peerFeatures
33 portNumber = updated.portNumber
35 supported = updated.supported
39 static def FlowCapableNode toInventoryAugment(FlowNode source) {
40 if (source instanceof FlowCapableNode) {
41 return source as FlowCapableNode;
43 val it = new FlowCapableNodeBuilder(source);