Converted the storer's interface to byte[]
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user