This is my defined File class as below.
public class File() {
let chunkHashMap = HashMap.HashMap<Nat, [Nat8]>(1, Nat.equal, Int.hash);
public func insertChunk(chunkNumber : Nat, fileChunk : [Nat8]) {
chunkHashMap.put(chunkNumber, fileChunk);
};
};
Now let’s say I have a hashmap as files = HashMap<Text, File>(1, Text.equal, Text.hash).
let isSuccess = switch(files.get(fileName)) {
case(null) return false;
case(?file) file.insertChunk(chunkNumber, fileChunk);
};
return isSuccess;
So, does above code will update the value for the corresponding key in hash-map “files”. So my main question is does files.get(fileName) returns reference to File class object?