Package it.unitn.disi.ds1.qtop
Record Class Utils.VotePair
java.lang.Object
java.lang.Record
it.unitn.disi.ds1.qtop.Utils.VotePair
- Record Components:
votes
- map of votersfinalDecision
- coordinator final decision
- Enclosing class:
Utils
public static record Utils.VotePair(HashMap<akka.actor.ActorRef,Utils.Vote> votes, Utils.Decision finalDecision)
extends Record
Struct to represent the map of voters for every write, and the final decision taken for that write.
-
Constructor Summary
ConstructorDescriptionVotePair
(HashMap<akka.actor.ActorRef, Utils.Vote> votes, Utils.Decision finalDecision) Creates an instance of aVotePair
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Returns the value of thefinalDecision
record component.final int
hashCode()
Returns a hash code value for this object.final String
toString()
Returns a string representation of this record class.HashMap
<akka.actor.ActorRef, Utils.Vote> votes()
Returns the value of thevotes
record component.
-
Constructor Details
-
VotePair
Creates an instance of aVotePair
record class.- Parameters:
votes
- the value for thevotes
record componentfinalDecision
- the value for thefinalDecision
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
votes
Returns the value of thevotes
record component.- Returns:
- the value of the
votes
record component
-
finalDecision
Returns the value of thefinalDecision
record component.- Returns:
- the value of the
finalDecision
record component
-