public class ERSDataGroup extends ERSCachingData
Such data groups represent a set of one or more data objects (e.g. electronic documents) for which an Evidence Record should be generated. Data groups will be encapsulated in a single PartialHashtree so that the presence of the group can be checked for, as well as the individual items that make it up.
Modifier and Type | Field and Description |
---|---|
protected java.util.List<ERSData> |
dataObjects |
Constructor and Description |
---|
ERSDataGroup(ERSData... dataObjects)
Base constructor for an "array" of data objects.
|
ERSDataGroup(ERSData dataObject)
Constructor for a group with a single object.
|
ERSDataGroup(java.util.List<ERSData> dataObjects)
Base constructor using a list of data objects.
|
Modifier and Type | Method and Description |
---|---|
protected byte[] |
calculateHash(DigestCalculator digestCalculator,
byte[] previousChainHash)
Generates a hash for the whole DataGroup.
|
byte[] |
getHash(DigestCalculator digestCalculator,
byte[] previousChainHash)
Return the calculated hash for the Data
|
java.util.List<byte[]> |
getHashes(DigestCalculator digestCalculator,
byte[] previousChainHash)
Generates hashes for all the data objects included in the data group with a previous chain hash.
|
int |
size()
Return the number of data objects present in the group.
|
protected java.util.List<ERSData> dataObjects
public ERSDataGroup(ERSData... dataObjects)
dataObjects
- an array of data objects.public ERSDataGroup(java.util.List<ERSData> dataObjects)
dataObjects
- a list of data objects.public ERSDataGroup(ERSData dataObject)
dataObject
- the data object to go in the group.public java.util.List<byte[]> getHashes(DigestCalculator digestCalculator, byte[] previousChainHash)
digestCalculator
- the DigestCalculator
to use for computing the hashespublic byte[] getHash(DigestCalculator digestCalculator, byte[] previousChainHash)
getHash
in interface ERSData
getHash
in class ERSCachingData
digestCalculator
- digest calculator to use.previousChainHash
- hash from an earlier chain if it needs to be included.protected byte[] calculateHash(DigestCalculator digestCalculator, byte[] previousChainHash)
calculateHash
in class ERSCachingData
digestCalculator
- the DigestCalculator
to use for computing the hashpublic int size()