2 * Copyright (c) 2016 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.actions;
10 import java.math.BigInteger;
11 import org.opendaylight.genius.mdsalutil.ActionInfo;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxOfInPortCaseBuilder;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nodes.node.table.flow.instructions.instruction.instruction.apply.actions._case.apply.actions.action.action.NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder;
19 import org.opendaylight.yangtools.yang.common.Empty;
22 * NX load in port action.
24 public class ActionNxLoadInPort extends ActionInfo {
26 private final BigInteger value;
28 public ActionNxLoadInPort(BigInteger value) {
32 public ActionNxLoadInPort(int actionKey, BigInteger value) {
38 public Action buildAction() {
39 return buildAction(getActionKey());
43 public Action buildAction(int newActionKey) {
44 return new ActionBuilder()
45 .setAction(new NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder()
46 .setNxRegLoad(new NxRegLoadBuilder()
47 .setDst(new DstBuilder()
48 .setDstChoice(new DstNxOfInPortCaseBuilder().setOfInPort(Empty.getInstance()).build())
55 .withKey(new ActionKey(newActionKey))
59 public BigInteger getValue() {
64 public boolean equals(Object other) {
68 if (other == null || getClass() != other.getClass()) {
71 if (!super.equals(other)) {
75 ActionNxLoadInPort that = (ActionNxLoadInPort) other;
77 return value != null ? value.equals(that.value) : that.value == null;
81 public int hashCode() {
82 int result = super.hashCode();
83 result = 31 * result + (value != null ? value.hashCode() : 0);
88 public String toString() {
89 return "ActionNxLoadInPort [value=" + value + ", getActionKey()=" + getActionKey() + "]";