Package org.onosproject.cluster
Class PartitionDiff
- java.lang.Object
-
- org.onosproject.cluster.PartitionDiff
-
public class PartitionDiff extends java.lang.ObjectUtility for examining differences between twopartitionvalues.
-
-
Constructor Summary
Constructors Constructor Description PartitionDiff(Partition oldValue, Partition newValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)booleanhasChanged()Returns if there are differences between the two values.inthashCode()booleanisAdded(NodeId nodeId)Returns if the specified node is introduced in the new value.booleanisRemoved(NodeId nodeId)Returns if the specified node is removed in the new value.PartitionnewValue()Returns the new partition value.PartitionoldValue()Returns the old partition value.PartitionIdpartitionId()Returns the new partition identifier.java.lang.StringtoString()
-
-
-
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:
trueif yes;falseotherwise
-
isAdded
public boolean isAdded(NodeId nodeId)
Returns if the specified node is introduced in the new value.- Parameters:
nodeId- node identifier- Returns:
trueif yes;falseotherwise
-
isRemoved
public boolean isRemoved(NodeId nodeId)
Returns if the specified node is removed in the new value.- Parameters:
nodeId- node identifier- Returns:
trueif yes;falseotherwise
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-