Added copyright and updated appropriate log levels
[vpnservice.git] / mdsalutil / mdsalutil-api / src / main / java / org / opendaylight / vpnservice / mdsalutil / ActionInfo.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.Arrays;
13
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
15
16 public class ActionInfo implements Serializable{
17
18     private static final long serialVersionUID = 1L;
19     private final ActionType m_actionType;
20     private String[] m_asActionValues = null;
21     private BigInteger [] m_aBigIntValues;
22     private int m_actionKey = 0;
23
24     public ActionInfo(ActionInfo action) {
25         super();
26         m_actionType = action.m_actionType;
27         m_actionKey = action.m_actionKey;
28         m_asActionValues = Arrays.copyOf(action.m_asActionValues, action.m_asActionValues.length);
29     }
30
31     public ActionInfo(ActionType actionType, String[] asActionValues) {
32         m_actionType = actionType;
33         m_actionKey = 0;
34         m_asActionValues = asActionValues;
35     } 
36     
37     public ActionInfo(ActionType actionType, BigInteger[] aBigIntValues) {
38         m_actionType = actionType;
39         m_actionKey = 0;
40         m_aBigIntValues = aBigIntValues;
41     }
42
43     public void setActionKey(int key) {
44         m_actionKey = key;
45     }
46
47     public int getActionKey() {
48         return m_actionKey;
49     }
50
51     public Action buildAction() {
52         return m_actionType.buildAction(this);
53     }
54
55     public ActionType getActionType() {
56         return m_actionType;
57     }
58
59     public String[] getActionValues() {
60         return m_asActionValues;
61     }
62     
63     public BigInteger[] getBigActionValues() {
64         return m_aBigIntValues;
65     }
66 }