Package org.onosproject.cluster
Class PartitionId
- java.lang.Object
-
- org.onlab.util.Identifier<java.lang.Integer>
-
- org.onosproject.cluster.PartitionId
-
- All Implemented Interfaces:
java.lang.Comparable<PartitionId>
public class PartitionId extends Identifier<java.lang.Integer> implements java.lang.Comparable<PartitionId>
Partition
identifier.
-
-
Field Summary
-
Fields inherited from class org.onlab.util.Identifier
identifier
-
-
Constructor Summary
Constructors Constructor Description PartitionId(int id)
Creates a partition identifier from an integer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
asInt()
Returns the partition identifier as an integer.int
compareTo(PartitionId that)
static PartitionId
from(int id)
Creates a partition identifier from an integer.-
Methods inherited from class org.onlab.util.Identifier
equals, hashCode, id, toString
-
-
-
-
Method Detail
-
from
public static PartitionId from(int id)
Creates a partition identifier from an integer.- Parameters:
id
- input integer- Returns:
- partition identification
-
asInt
public int asInt()
Returns the partition identifier as an integer.- Returns:
- number
-
compareTo
public int compareTo(PartitionId that)
- Specified by:
compareTo
in interfacejava.lang.Comparable<PartitionId>
-
-