Interface IConsentVote
- All Known Implementing Classes:
ConsentOperationStatusEnum
,ConsentOutcome
public interface IConsentVote
Something that produces a vote, along with static
tools for combining votes.
-
Method Summary
Modifier and TypeMethodDescriptionGet the votestatic <T extends IConsentVote>
TparallelReduce
(T theSeed, Stream<T> theVoteStream) Evaluate all verdicts together, allowing any to veto (i.e.static <T extends IConsentVote>
TparallelReduce
(T theAccumulator, T theNextVoter) Evaluate two votes together, allowing either to veto (i.e.static <T extends IConsentVote>
TserialReduce
(T theSeed, Stream<T> theVoterStream) Evaluate verdicts in order, taking the first "decision" (i.e.static <T extends IConsentVote>
TserialReduce
(T theAccumulator, T theNextVoter) Evaluate verdicts in order, taking the first "decision" (i.e.
-
Method Details
-
getStatus
Get the vote- Returns:
- the vote
-
parallelReduce
Evaluate all verdicts together, allowing any to veto (i.e. REJECT) the operation.- If any vote is REJECT, then the result is REJECT.
- If no vote is REJECT, and any vote is AUTHORIZED, then the result is AUTHORIZED.
- If no vote is REJECT or AUTHORIZED, the result is PROCEED.
- Returns:
- REJECT if any reject, AUTHORIZED if no REJECT and some AUTHORIZED, PROCEED if empty or all PROCEED
-
parallelReduce
Evaluate two votes together, allowing either to veto (i.e. REJECT) the operation.- Returns:
- REJECT if either reject, AUTHORIZED if no REJECT and some AUTHORIZED, PROCEED otherwise
-
serialReduce
Evaluate verdicts in order, taking the first "decision" (i.e. first non-PROCEED) verdict.- Returns:
- the first decisive verdict, or theSeed when empty or all PROCEED.
-
serialReduce
Evaluate verdicts in order, taking the first "decision" (i.e. first non-PROCEED) verdict.- Parameters:
theAccumulator
- the verdict so fattheNextVoter
- the next verdict to consider- Returns:
- the combined verdict
-