blob: 04bc5602874e15df48e3675bfa8d1573eab944dc [file] [log] [blame]
Carmelo Cascone41605742017-06-19 15:46:44 +09001/*
2 * Copyright 2017-present Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.net.flow;
18
19import org.onlab.util.Identifier;
20
21/**
22 * Table identifier representing the position of the table in the pipeline.
23 */
24public final class IndexTableId extends Identifier<Integer> implements TableId {
25
26 private IndexTableId(int index) {
27 super(index);
28 }
29
30 @Override
31 public Type type() {
32 return Type.INDEX;
33 }
34
35 /**
36 * Returns a table identifier for the given index.
37 *
38 * @param index table index
39 * @return table identifier
40 */
41 public static IndexTableId of(int index) {
42 return new IndexTableId(index);
43 }
44}