leola
import java.util.HashMap;
module MyLibrary {
export function createHashMap() {
return new HashMap<String, Object>();
}
export function addKeyValuePair(map: HashMap<String, Object>, key: String, value: Object) {
map.put(key, value);
}
export function getValue(map: HashMap<String, Object>, key: String): Object {
return map.get(key);
}
}
import leola.MyLibrary;
public class Main {
public static void main(String[] args) {
HashMap<String, Object> map = MyLibrary.createHashMap();
MyLibrary.addKeyValuePair(map, "key", "value");
Object value = MyLibrary.getValue(map, "key");
System.out.println(value);
}
}