Converted the storer's interface to byte[]

This commit is contained in:
Marcin Grzejszczak
2018-11-12 22:23:14 +01:00
parent 72f171ed6c
commit a0aaee7578
6 changed files with 18 additions and 18 deletions

View File

@@ -4,7 +4,7 @@ import java.util.HashMap;
import java.util.Map;
/**
* Defines how to store converted contracts to a String representation
* Defines how to store converted contracts to a byte array representation
* that can be stored to drive
*
* @author Marcin Grzejszczak
@@ -15,11 +15,11 @@ public interface ContractStorer<T> {
* Stores the contracts as a map of filename and String
*
* @param contracts - to convert
* @return mapping of filename to converted String representation of the contract
* @return mapping of filename to converted byte array representation of the contract
*/
default Map<String, String> storeAsString(T contracts) {
Map<String, String> map = new HashMap<>();
map.put(String.valueOf(Math.abs(hashCode())), contracts.toString());
default Map<String, byte[]> store(T contracts) {
Map<String, byte[]> map = new HashMap<>();
map.put(String.valueOf(Math.abs(hashCode())), contracts.toString().getBytes());
return map;
}
}