Updated L2Gw changes in "neutronvpn", "elanmanager" and "dhcpservice" modules
[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, String[] asActionValues, int actionKey) {
38         m_actionType = actionType;
39         m_actionKey = actionKey;
40         m_asActionValues = asActionValues;
41     }
42     
43     public ActionInfo(ActionType actionType, BigInteger[] aBigIntValues) {
44         m_actionType = actionType;
45         m_actionKey = 0;
46         m_aBigIntValues = aBigIntValues;
47     }
48
49     public ActionInfo(ActionType actionType, BigInteger[] aBigIntValues, int actionKey) {
50         m_actionType = actionType;
51         m_actionKey = actionKey;
52         m_aBigIntValues = aBigIntValues;
53     }
54
55     public void setActionKey(int key) {
56         m_actionKey = key;
57     }
58
59     public int getActionKey() {
60         return m_actionKey;
61     }
62
63     public Action buildAction() {
64         return m_actionType.buildAction(this);
65     }
66
67     public ActionType getActionType() {
68         return m_actionType;
69     }
70
71     public String[] getActionValues() {
72         return m_asActionValues;
73     }
74     
75     public BigInteger[] getBigActionValues() {
76         return m_aBigIntValues;
77     }
78 }