Bug 5540 - FlowConvertor, FlowStatsResponseConvertor, FlowInstructionResponseConvertor
[openflowplugin.git] / openflowplugin / src / main / java / org / opendaylight / openflowplugin / openflow / md / core / sal / convertor / flow / cases / ClearActionsCase.java
1 /*
2  * Copyright (c) 2016 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.cases;
10
11 import java.util.Optional;
12 import javax.annotation.Nonnull;
13 import org.opendaylight.openflowplugin.api.OFConstants;
14 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.action.data.ActionConvertorData;
15 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.ConvertorCase;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instruction.grouping.instruction.choice.ClearActionsCaseBuilder;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.Instruction;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731.instructions.grouping.InstructionBuilder;
19
20 public class ClearActionsCase extends ConvertorCase<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ClearActionsCase, Instruction, ActionConvertorData> {
21     public ClearActionsCase() {
22         super(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ClearActionsCase.class, true, OFConstants.OFP_VERSION_1_0, OFConstants.OFP_VERSION_1_3);
23     }
24
25     @Override
26     public Optional<Instruction> process(final @Nonnull org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.ClearActionsCase source, final ActionConvertorData data) {
27         ClearActionsCaseBuilder clearActionsCaseBuilder = new ClearActionsCaseBuilder();
28         InstructionBuilder instructionBuilder = new InstructionBuilder();
29         instructionBuilder.setInstructionChoice(clearActionsCaseBuilder.build());
30         return Optional.of(instructionBuilder.build());
31     }
32 }