Bug 5540 - FlowConvertor, FlowStatsResponseConvertor, FlowInstructionResponseConvertor
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / sal / convertor / flow / flowflag / FlowFlagsConvertorV10Impl.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow.flowflag;
10
11 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.flow.FlowConvertor;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowModFlags;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.FlowModFlagsV10;
14
15 /**
16  *
17  */
18 public class FlowFlagsConvertorV10Impl implements FlowFlagConvertor<FlowModFlagsV10> {
19
20     @Override
21     public FlowModFlagsV10 convert(
22             FlowModFlags source) {
23
24         FlowModFlagsV10 ofFlowModFlags;
25         if (source != null) {
26             ofFlowModFlags = new FlowModFlagsV10(
27                     source.isCHECKOVERLAP(), FlowConvertor.DEFAULT_OFPFF_EMERGENCY, source.isSENDFLOWREM());
28         } else {
29             ofFlowModFlags = new FlowModFlagsV10(
30                     FlowConvertor.DEFAULT_OFPFF_CHECK_OVERLAP,
31                     FlowConvertor.DEFAULT_OFPFF_EMERGENCY,
32                     FlowConvertor.DEFAULT_OFPFF_FLOW_REM);
33         }
34
35         return ofFlowModFlags;
36     }
37 }