Package org.onosproject.cluster
Class DefaultPartition
- java.lang.Object
-
- org.onosproject.cluster.DefaultPartition
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultPartition()
Constructs an empty partition for the serializer.DefaultPartition(Partition other)
Constructs a partition that is a copy of another.DefaultPartition(PartitionId id, java.util.Collection<NodeId> members)
Constructs a partition.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
PartitionId
getId()
Returns the partition identifier.java.util.Collection<NodeId>
getMembers()
Returns the controller nodes that are members of this partition.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
DefaultPartition
protected DefaultPartition()
Constructs an empty partition for the serializer.
-
DefaultPartition
public DefaultPartition(PartitionId id, java.util.Collection<NodeId> members)
Constructs a partition.- Parameters:
id
- partition identifiermembers
- partition member nodes
-
DefaultPartition
public DefaultPartition(Partition other)
Constructs a partition that is a copy of another.- Parameters:
other
- partition to copy
-
-
Method Detail
-
getId
public PartitionId getId()
Description copied from interface:Partition
Returns the partition identifier.
-
getMembers
public java.util.Collection<NodeId> getMembers()
Description copied from interface:Partition
Returns the controller nodes that are members of this partition.- Specified by:
getMembers
in interfacePartition
- Returns:
- collection of controller node identifiers
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
-