2 * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. 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;
10 import com.google.common.base.MoreObjects;
11 import java.io.Serializable;
12 import java.math.BigInteger;
13 import java.util.Arrays;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
17 public class ActionInfo implements Serializable {
19 private static final long serialVersionUID = 1L;
21 private final ActionType m_actionType;
23 private String[] m_asActionValues = null;
24 private BigInteger[] m_aBigIntValues;
25 private int m_actionKey = 0;
27 public ActionInfo(ActionInfo action) {
29 m_actionType = action.m_actionType;
30 m_actionKey = action.m_actionKey;
31 m_asActionValues = Arrays.copyOf(action.m_asActionValues, action.m_asActionValues.length);
34 public ActionInfo(ActionType actionType, String[] asActionValues) {
35 m_actionType = actionType;
37 m_asActionValues = asActionValues;
40 public ActionInfo(ActionType actionType, String[] asActionValues, int actionKey) {
41 m_actionType = actionType;
42 m_actionKey = actionKey;
43 m_asActionValues = asActionValues;
46 public ActionInfo(ActionType actionType, BigInteger[] aBigIntValues) {
47 m_actionType = actionType;
49 m_aBigIntValues = aBigIntValues;
52 public ActionInfo(ActionType actionType, BigInteger[] aBigIntValues, int actionKey) {
53 m_actionType = actionType;
54 m_actionKey = actionKey;
55 m_aBigIntValues = aBigIntValues;
58 public void setActionKey(int key) {
62 public int getActionKey() {
66 public Action buildAction() {
67 return m_actionType.buildAction(this);
70 public ActionType getActionType() {
74 public String[] getActionValues() {
75 return m_asActionValues;
78 public BigInteger[] getBigActionValues() {
79 return m_aBigIntValues;
83 public String toString() {
84 return MoreObjects.toStringHelper(this).omitNullValues().add("actionType", m_actionType)
85 .add("actionValues", Arrays.deepToString(m_asActionValues))
86 .add("bigActionValues", Arrays.deepToString(m_aBigIntValues))
87 .add("actionKey", m_actionKey).toString();