2 * Copyright (c) 2019 Alten Calsoft Labs India 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.actions;
10 import java.util.Collections;
11 import org.opendaylight.genius.mdsalutil.ActionInfo;
12 import org.opendaylight.openflowplugin.extension.api.GroupingLooseResolver;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.SetFieldCaseBuilder;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.action.set.field._case.SetFieldBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionKey;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.eric.match.rev180730.EricAugMatchNodesNodeTableFlowBuilder;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.eric.match.rev180730.Icmpv6NdReservedKey;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.eric.match.rev180730.eric.of.icmpv6.nd.reserved.grouping.EricOfIcmpv6NdReservedBuilder;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlowWriteActionsSetField;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralAugMatchNodesNodeTableFlowWriteActionsSetFieldBuilder;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.GeneralExtensionListGrouping;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.ExtensionBuilder;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.list.grouping.ExtensionListBuilder;
28 * Set source IPv6 action.
30 public class ActionNdReserved extends ActionInfo {
32 private final long ndReserved;
34 public ActionNdReserved(long ndReserved) {
38 public ActionNdReserved(int actionKey, long ndReserved) {
40 this.ndReserved = ndReserved;
43 public long getNdReserved() {
48 public Action buildAction() {
49 return buildAction(getActionKey());
53 public Action buildAction(int newActionKey) {
54 GroupingLooseResolver<GeneralExtensionListGrouping> eqGroup =
55 new GroupingLooseResolver<>(GeneralExtensionListGrouping.class);
56 eqGroup.add(GeneralAugMatchNodesNodeTableFlowWriteActionsSetField.class);
58 return new ActionBuilder()
59 .setAction(new SetFieldCaseBuilder()
60 .setSetField(new SetFieldBuilder()
61 .addAugmentation(new GeneralAugMatchNodesNodeTableFlowWriteActionsSetFieldBuilder()
62 .setExtensionList(Collections.singletonList(new ExtensionListBuilder()
63 .setExtension(new ExtensionBuilder()
64 .addAugmentation(new EricAugMatchNodesNodeTableFlowBuilder()
65 .setEricOfIcmpv6NdReserved(new EricOfIcmpv6NdReservedBuilder()
66 .setIcmpv6NdReserved(ndReserved)
70 .setExtensionKey(Icmpv6NdReservedKey.class)
75 .withKey(new ActionKey(newActionKey))
80 public boolean equals(Object other) {
84 if (other == null || getClass() != other.getClass()) {
87 if (!super.equals(other)) {
91 ActionNdReserved that = (ActionNdReserved) other;
93 return ndReserved == that.ndReserved;
97 public int hashCode() {
98 int result = super.hashCode();
99 result = 31 * result + (int) (ndReserved ^ ndReserved >>> 32);
104 public String toString() {
105 return "ActionNdReserved [source=" + ndReserved + ", getActionKey()=" + getActionKey() + "]";