Added copyright and updated appropriate log levels
[vpnservice.git] / mdsalutil / mdsalutil-api / src / main / java / org / opendaylight / vpnservice / mdsalutil / InstructionInfo.java
1 /*
2  * Copyright (c) 2015 Ericsson India Global Services Pvt Ltd. 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 package org.opendaylight.vpnservice.mdsalutil;
9
10 import java.io.Serializable;
11 import java.math.BigInteger;
12 import java.util.List;
13
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
15
16 public class InstructionInfo implements Serializable {
17     private static final long serialVersionUID = 1L;
18
19     private final InstructionType m_instructionType;
20     private long[] m_alInstructionValues;
21     private BigInteger[] m_alBigInstructionValues;
22     private List<ActionInfo> m_actionInfos;
23
24     // This constructor should be used incase of clearAction
25     public InstructionInfo(InstructionType instructionType) {
26         m_instructionType = instructionType;
27     }
28
29     public InstructionInfo(InstructionType instructionType, long[] instructionValues) {
30         m_instructionType = instructionType;
31         m_alInstructionValues = instructionValues;
32     }
33
34     public InstructionInfo(InstructionType instructionType, BigInteger[] instructionValues) {
35         m_instructionType = instructionType;
36         m_alBigInstructionValues = instructionValues;
37     }
38
39     public InstructionInfo(InstructionType instructionType, List<ActionInfo> actionInfos) {
40         m_instructionType = instructionType;
41         m_actionInfos = actionInfos;
42     }
43
44     public Instruction buildInstruction(int instructionKey) {
45         return m_instructionType.buildInstruction(this, instructionKey);
46     }
47
48     public InstructionType getInstructionType() {
49         return m_instructionType;
50     }
51
52     public long[] getInstructionValues() {
53         return m_alInstructionValues;
54     }
55
56     public BigInteger[] getBigInstructionValues() {
57         return m_alBigInstructionValues;
58     }
59
60     public List<ActionInfo> getActionInfos() {
61         return m_actionInfos;
62     }
63
64     public void setInstructionValues(long[] m_alInstructionValues) {
65         this.m_alInstructionValues = m_alInstructionValues;
66     }
67
68 }