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 org.opendaylight.genius.mdsalutil.ActionInfo;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.dst.choice.grouping.dst.choice.DstNxOfInPortCaseBuilder;
15 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;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.NxRegLoadBuilder;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.action.rev140714.nx.action.reg.load.grouping.nx.reg.load.DstBuilder;
18 import org.opendaylight.yangtools.yang.common.Empty;
19 import org.opendaylight.yangtools.yang.common.Uint16;
20 import org.opendaylight.yangtools.yang.common.Uint64;
23 * NX load in port action.
25 public class ActionNxLoadInPort extends ActionInfo {
27 private final Uint64 value;
29 public ActionNxLoadInPort(Uint64 value) {
33 public ActionNxLoadInPort(int actionKey, Uint64 value) {
39 public Action buildAction() {
40 return buildAction(getActionKey());
44 public Action buildAction(int newActionKey) {
45 return new ActionBuilder()
46 .setAction(new NxActionRegLoadNodesNodeTableFlowApplyActionsCaseBuilder()
47 .setNxRegLoad(new NxRegLoadBuilder()
48 .setDst(new DstBuilder()
49 .setDstChoice(new DstNxOfInPortCaseBuilder().setOfInPort(Empty.getInstance()).build())
50 .setStart(Uint16.ZERO)
56 .withKey(new ActionKey(newActionKey))
60 public Uint64 getValue() {
65 public boolean equals(Object other) {
69 if (other == null || getClass() != other.getClass()) {
72 if (!super.equals(other)) {
76 ActionNxLoadInPort that = (ActionNxLoadInPort) other;
78 return value != null ? value.equals(that.value) : that.value == null;
82 public int hashCode() {
83 int result = super.hashCode();
84 result = 31 * result + (value != null ? value.hashCode() : 0);
89 public String toString() {
90 return "ActionNxLoadInPort [value=" + value + ", getActionKey()=" + getActionKey() + "]";