Skip to content

Commit 7aa39a9

Browse files
committed
Added and fixed some minor features
Credits for these changes: GitHub constributor 'Stefan K.' Added/fixed methods * public ArrayList<Object> getAllAsArrayList() --> previously getAll() * public HashMap<String, Object> getAll() --> previously returning ArrayList<Object> * public void printAll() --> prints all stored keys with corresponding objects
1 parent 22b1aa9 commit 7aa39a9

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

com/blogspot/debukkitsblog/Util/FileStorage.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,31 @@ public Object get(String key){
8888
* All stored objects in an ArrayList of Objects
8989
* @return all stored objects in an ArrayList of Objects
9090
*/
91-
public ArrayList<Object> getAll(){
91+
public ArrayList<Object> getAllAsArrayList(){
9292
ArrayList<Object> result = new ArrayList<Object>();
9393
for(Object c: storageMap.values()){
9494
result.add(c);
9595
}
9696
return result;
9797
}
9898

99+
/**
100+
* All stored objects in a HashMap of Strings and Objects
101+
* @return all stored objects in a HashMap of Strings and Objects
102+
*/
103+
public HashMap<String, Object> getAll(){
104+
return storageMap;
105+
}
106+
107+
/**
108+
* Prints all stored keys with corresponding objects
109+
*/
110+
public void printAll(){
111+
for(String cKey : storageMap.keySet()){
112+
System.out.println(cKey + " :: " + storageMap.get(cKey));
113+
}
114+
}
115+
99116
/**
100117
* Removes an Key-Object pair from the storage
101118
* @param key

0 commit comments

Comments
 (0)