View Javadoc
1   package civitas.common.mix.votemix;
2   
3   import org.springframework.beans.factory.annotation.Autowired;
4   import org.springframework.stereotype.Controller;
5   
6   import civitas.common.EncryptedVote;
7   import civitas.common.mix.AddCommitmentToMix;
8   import jakarta.annotation.Nonnull;
9   
10  @Controller
11  public class AddVoteAndCommitmentToVoteMix {
12  	@Autowired
13  	AddCommitmentToMix addCommitmentToMix;
14  
15  	@Autowired
16  	AddVoteToVoteMix addVoteToVoteMix;
17  
18  	public void apply(@Nonnull final VoteMix that, @Nonnull final EncryptedVote v, @Nonnull final byte[] commitment) {
19  		if (null == that || null == v || null == commitment) {
20  			throw new NullPointerException();
21  		}
22  		addVoteToVoteMix.apply(that, v);
23  		addCommitmentToMix.apply(that, commitment);
24  	}
25  }