diff options
author | Gunther6070 <haydenhartman10@yahoo.com> | 2025-03-25 08:21:01 -0400 |
---|---|---|
committer | Gunther6070 <haydenhartman10@yahoo.com> | 2025-03-25 08:21:01 -0400 |
commit | ffbe2870d320c4127d32307f2646f39e2e284eec (patch) | |
tree | f9f46447c689c1667f04f17bfbf2e8d07ff0fcd0 /ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/CupboardFileDAO.java | |
parent | d31c1aec7f615646553a227c8e235d4ae2679c68 (diff) | |
parent | c15aa3daab0cf9a640945d4e634d1327fb55d2db (diff) | |
download | JellySolutions-ffbe2870d320c4127d32307f2646f39e2e284eec.tar.gz JellySolutions-ffbe2870d320c4127d32307f2646f39e2e284eec.tar.bz2 JellySolutions-ffbe2870d320c4127d32307f2646f39e2e284eec.zip |
Merge branch 'api-cleanup' of https://github.com/RIT-SWEN-261-02/team-project-2245-swen-261-02-2b into api-cleanup
Diffstat (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/CupboardFileDAO.java')
-rw-r--r-- | ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/CupboardFileDAO.java | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/CupboardFileDAO.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/CupboardFileDAO.java index 4d11554..3115204 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/CupboardFileDAO.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/persistence/CupboardFileDAO.java @@ -53,22 +53,13 @@ public class CupboardFileDAO implements CupboardDAO { } /** - * Return an array of the needs - * - * @return An array of all the needs - */ - private Need[] getNeedsArray() { - return needs.values().toArray(Need[]::new); - } - - /** * Saves the needs to json * * @return True if the save was successful, false otherwise * @throws IOException If there was an IO issue saving the file */ private boolean save() throws IOException { - Need[] needArray = getNeedsArray(); + Need[] needArray = needs.values().toArray(Need[]::new); objectMapper.writeValue(new File(filename), needArray); return true; @@ -77,7 +68,7 @@ public class CupboardFileDAO implements CupboardDAO { @Override public Need[] getNeeds() { synchronized (needs) { - return getNeedsArray(); + return needs.values().toArray(Need[]::new); } } |