blob: a8ad99c43217f56b7f857fa788ae8c3d1fef3a3e [file] [log] [blame]
Jonathan Hart74c83132015-02-02 18:37:57 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Jonathan Hart74c83132015-02-02 18:37:57 -08003 *
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 */
16package org.onosproject.store.intent.impl;
17
Jian Lib6d998e2016-02-29 11:41:18 -080018import org.onlab.util.Identifier;
Jonathan Hart74c83132015-02-02 18:37:57 -080019
20/**
21 * Identifies a partition of the intent keyspace which will be assigned to and
22 * processed by a single ONOS instance at a time.
23 */
Jian Lib6d998e2016-02-29 11:41:18 -080024final class PartitionId extends Identifier<Integer> {
Jonathan Hart74c83132015-02-02 18:37:57 -080025 /**
26 * Creates a new partition ID.
27 *
28 * @param id the partition ID
29 */
Jonathan Hartf2fda812015-02-17 15:21:03 -080030 PartitionId(int id) {
Jian Lib6d998e2016-02-29 11:41:18 -080031 super(id);
Jonathan Hart74c83132015-02-02 18:37:57 -080032 }
33
Jonathan Hartf2fda812015-02-17 15:21:03 -080034 /**
35 * Returns the integer ID value.
36 *
37 * @return ID value
38 */
Sho SHIMIZU26cc1802016-01-15 12:40:43 -080039 int value() {
Jian Lib6d998e2016-02-29 11:41:18 -080040 return identifier;
Jonathan Hart74c83132015-02-02 18:37:57 -080041 }
42}