2 * Copyright © 2017 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.instructions;
10 import org.opendaylight.genius.mdsalutil.InstructionInfo;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.GoToTableCaseBuilder;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.instruction.go.to.table._case.GoToTableBuilder;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.InstructionKey;
18 * Goto table instruction.
20 public class InstructionGotoTable implements InstructionInfo {
21 private final short tableId;
23 public InstructionGotoTable(short tableId) {
24 this.tableId = tableId;
28 public Instruction buildInstruction(int instructionKey) {
29 return new InstructionBuilder()
30 .setInstruction(new GoToTableCaseBuilder()
31 .setGoToTable(new GoToTableBuilder()
37 .setKey(new InstructionKey(instructionKey))
42 public boolean equals(Object o) {
43 if (this == o) return true;
44 if (o == null || getClass() != o.getClass()) return false;
46 InstructionGotoTable that = (InstructionGotoTable) o;
48 return tableId == that.tableId;
52 public int hashCode() {