blob: 614d35de4d170dc29db093e5cceec7e27cf90407 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2014-present Open Networking Laboratory
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07003 *
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 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.topology;
tomcfde0622014-09-09 11:02:42 -070017
Jian Lib6d998e2016-02-29 11:41:18 -080018import org.onlab.util.Identifier;
tomcfde0622014-09-09 11:02:42 -070019
20/**
21 * Representation of the topology cluster identity.
22 */
Jian Lib6d998e2016-02-29 11:41:18 -080023public final class ClusterId extends Identifier<Integer> {
tomcfde0622014-09-09 11:02:42 -070024
25 // Public construction is prohibit
26 private ClusterId(int id) {
Jian Lib6d998e2016-02-29 11:41:18 -080027 super(id);
tomcfde0622014-09-09 11:02:42 -070028 }
29
30 /**
31 * Returns the cluster identifier, represented by the specified integer
32 * serial number.
33 *
34 * @param id integer serial number
35 * @return cluster identifier
36 */
37 public static ClusterId clusterId(int id) {
38 return new ClusterId(id);
39 }
40
tom97937552014-09-11 10:48:42 -070041 /**
42 * Returns the backing integer index.
43 *
44 * @return backing integer index
45 */
46 public int index() {
Jian Lib6d998e2016-02-29 11:41:18 -080047 return identifier;
tom97937552014-09-11 10:48:42 -070048 }
tomcfde0622014-09-09 11:02:42 -070049}