Package io.cloudstate.javasupport.crdt
Interface Vote
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleangetSelfVote()Get the current value for this nodes vote.intgetVoters()Get the number of voters participating in the vote (ie, the number of nodes in the cluster).intgetVotesFor()Get the number of votes for.default booleanisAtLeastOne()Has at least one node voted true?default booleanisMajority()Have a majority of nodes voted true?default booleanisUnanimous()Is the vote unanimous?voidvote(boolean vote)Update this nodes vote to the given value.
-
-
-
Method Detail
-
getSelfVote
boolean getSelfVote()
Get the current value for this nodes vote.- Returns:
- This nodes vote.
-
getVoters
int getVoters()
Get the number of voters participating in the vote (ie, the number of nodes in the cluster).- Returns:
- The number of voters.
-
getVotesFor
int getVotesFor()
Get the number of votes for.- Returns:
- The number of votes for.
-
vote
void vote(boolean vote)
Update this nodes vote to the given value.- Parameters:
vote- The vote this node is contributing.
-
isAtLeastOne
default boolean isAtLeastOne()
Has at least one node voted true?- Returns:
- True if at least one node has voted true.
-
isMajority
default boolean isMajority()
Have a majority of nodes voted true?- Returns:
- True if more than half of the nodes have voted true.
-
isUnanimous
default boolean isUnanimous()
Is the vote unanimous?- Returns:
- True if all nodes have voted true.
-
-