69 lines
1.8 KiB
Java
69 lines
1.8 KiB
Java
|
package necessary;
|
||
|
|
||
|
|
||
|
import meerkat.protobuf.BulletinBoardAPI.*;
|
||
|
import meerkat.protobuf.Crypto.*;
|
||
|
|
||
|
import java.util.LinkedList;
|
||
|
import java.util.List;
|
||
|
|
||
|
/**
|
||
|
* Created by Arbel Deutsch Peled on 14-Dec-15.
|
||
|
*
|
||
|
* A data structure for holding a complete batch message along with its signature
|
||
|
*/
|
||
|
public class CompleteBatch {
|
||
|
|
||
|
private BeginBatchMessage beginBatchMessage;
|
||
|
private List<BatchData> batchDataList;
|
||
|
private Signature signature;
|
||
|
|
||
|
public CompleteBatch() {
|
||
|
batchDataList = new LinkedList<BatchData>();
|
||
|
}
|
||
|
|
||
|
public CompleteBatch(BeginBatchMessage newBeginBatchMessage) {
|
||
|
this();
|
||
|
beginBatchMessage = newBeginBatchMessage;
|
||
|
}
|
||
|
|
||
|
public CompleteBatch(BeginBatchMessage newBeginBatchMessage, List<BatchData> newDataList) {
|
||
|
this(newBeginBatchMessage);
|
||
|
appendBatchData(newDataList);
|
||
|
}
|
||
|
|
||
|
public CompleteBatch(BeginBatchMessage newBeginBatchMessage, List<BatchData> newDataList, Signature newSignature) {
|
||
|
this(newBeginBatchMessage, newDataList);
|
||
|
signature = newSignature;
|
||
|
}
|
||
|
|
||
|
public BeginBatchMessage getBeginBatchMessage() {
|
||
|
return beginBatchMessage;
|
||
|
}
|
||
|
|
||
|
public List<BatchData> getBatchDataList() {
|
||
|
return batchDataList;
|
||
|
}
|
||
|
|
||
|
public Signature getSignature() {
|
||
|
return signature;
|
||
|
}
|
||
|
|
||
|
public void setBeginBatchMessage(BeginBatchMessage beginBatchMessage) {
|
||
|
this.beginBatchMessage = beginBatchMessage;
|
||
|
}
|
||
|
|
||
|
public void appendBatchData(BatchData newBatchData) {
|
||
|
batchDataList.add(newBatchData);
|
||
|
}
|
||
|
|
||
|
public void appendBatchData(List<BatchData> newBatchDataList) {
|
||
|
batchDataList.addAll(newBatchDataList);
|
||
|
}
|
||
|
|
||
|
public void setSignature(Signature newSignature) {
|
||
|
signature = newSignature;
|
||
|
}
|
||
|
|
||
|
}
|