Package org.onosproject.cluster
Class PartitionDiff
- java.lang.Object
-
- org.onosproject.cluster.PartitionDiff
-
public class PartitionDiff extends java.lang.Object
Utility for examining differences between twopartition
values.
-
-
Constructor Summary
Constructors Constructor Description PartitionDiff(Partition oldValue, Partition newValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
boolean
hasChanged()
Returns if there are differences between the two values.int
hashCode()
boolean
isAdded(NodeId nodeId)
Returns if the specified node is introduced in the new value.boolean
isRemoved(NodeId nodeId)
Returns if the specified node is removed in the new value.Partition
newValue()
Returns the new partition value.Partition
oldValue()
Returns the old partition value.PartitionId
partitionId()
Returns the new partition identifier.java.lang.String
toString()
-
-
-
Method Detail
-
partitionId
public PartitionId partitionId()
Returns the new partition identifier.- Returns:
- partition id
-
oldValue
public Partition oldValue()
Returns the old partition value.- Returns:
- partition
-
newValue
public Partition newValue()
Returns the new partition value.- Returns:
- partition
-
hasChanged
public boolean hasChanged()
Returns if there are differences between the two values.- Returns:
true
if yes;false
otherwise
-
isAdded
public boolean isAdded(NodeId nodeId)
Returns if the specified node is introduced in the new value.- Parameters:
nodeId
- node identifier- Returns:
true
if yes;false
otherwise
-
isRemoved
public boolean isRemoved(NodeId nodeId)
Returns if the specified node is removed in the new value.- Parameters:
nodeId
- node identifier- Returns:
true
if yes;false
otherwise
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-