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 Type
    Method
    Description
    Get the vote
    static <T extends IConsentVote>
    T
    parallelReduce(T theSeed, Stream<T> theVoteStream)
    Evaluate all verdicts together, allowing any to veto (i.e.
    static <T extends IConsentVote>
    T
    parallelReduce(T theAccumulator, T theNextVoter)
    Evaluate two votes together, allowing either to veto (i.e.
    static <T extends IConsentVote>
    T
    serialReduce(T theSeed, Stream<T> theVoterStream)
    Evaluate verdicts in order, taking the first "decision" (i.e.
    static <T extends IConsentVote>
    T
    serialReduce(T theAccumulator, T theNextVoter)
    Evaluate verdicts in order, taking the first "decision" (i.e.
  • Method Details

    • getStatus

      Get the vote
      Returns:
      the vote
    • parallelReduce

      static <T extends IConsentVote> T parallelReduce(T theSeed, Stream<T> theVoteStream)
      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

      static <T extends IConsentVote> T parallelReduce(T theAccumulator, T theNextVoter)
      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

      static <T extends IConsentVote> T serialReduce(T theSeed, Stream<T> theVoterStream)
      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

      static <T extends IConsentVote> T serialReduce(T theAccumulator, T theNextVoter)
      Evaluate verdicts in order, taking the first "decision" (i.e. first non-PROCEED) verdict.
      Parameters:
      theAccumulator - the verdict so fat
      theNextVoter - the next verdict to consider
      Returns:
      the combined verdict