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.FlowNodeConnector
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeConnectorBuilder
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowNode
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNodeBuilder
17 class InventoryMapping {
19 static def FlowCapableNodeConnector toInventoryAugment(FlowNodeConnector updated) {
20 if (updated instanceof FlowCapableNodeConnector) {
21 return updated as FlowCapableNodeConnector;
23 val it = new FlowCapableNodeConnectorBuilder();
24 advertisedFeatures = updated.advertisedFeatures
25 configuration = updated.configuration
26 currentFeature = updated.currentFeature
27 currentSpeed = updated.currentSpeed
28 hardwareAddress = updated.hardwareAddress
29 maximumSpeed = updated.maximumSpeed
31 peerFeatures = updated.peerFeatures
32 portNumber = updated.portNumber
34 supported = updated.supported
38 static def FlowCapableNode toInventoryAugment(FlowNode source) {
39 if (source instanceof FlowCapableNode) {
40 return source as FlowCapableNode;
42 val it = new FlowCapableNodeBuilder(source);