2 * Copyright © 2017 Red Hat, 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.genius.mdsalutil.instructions;
10 import java.util.List;
11 import org.opendaylight.genius.mdsalutil.ActionInfo;
12 import org.opendaylight.genius.mdsalutil.ActionInfoList;
13 import org.opendaylight.genius.mdsalutil.InstructionInfo;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.WriteActionsCaseBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.write.actions._case.WriteActionsBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
21 * Write actions instruction.
23 public class InstructionWriteActions implements InstructionInfo {
24 private final ActionInfoList actions;
26 public InstructionWriteActions(List<ActionInfo> actionInfos) {
27 this.actions = new ActionInfoList(actionInfos);
31 public Instruction buildInstruction(int instructionKey) {
32 return new InstructionBuilder()
33 .setInstruction(new WriteActionsCaseBuilder()
34 .setWriteActions(new WriteActionsBuilder()
35 .setAction(actions.buildActions())
40 .setKey(new InstructionKey(instructionKey))