From d6f563c6288052e719f48939f484148b3068fead Mon Sep 17 00:00:00 2001 From: sowgro Date: Sun, 16 Feb 2025 15:05:39 -0500 Subject: Refactor: Remove Cupboard.java --- .../com/ufund/api/ufundapi/model/Cupboard.java | 51 ---------------------- 1 file changed, 51 deletions(-) delete mode 100644 ufund-api/src/main/java/com/ufund/api/ufundapi/model/Cupboard.java (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/model/Cupboard.java') diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Cupboard.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Cupboard.java deleted file mode 100644 index 0ce015c..0000000 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Cupboard.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.ufund.api.ufundapi.model; - -import com.ufund.api.ufundapi.persistence.CupboardDAO; -import com.ufund.api.ufundapi.persistence.CupboardFileDao; - -import java.io.IOException; - -public class Cupboard { - CupboardDAO dao = new CupboardFileDao(); - - public void createNeed(Need need) throws IOException { - int id = dao.getNeeds().length; - dao.createNeed(need); - } - -// public void updateID(int id) throws IOException { -// for (int i = 0; i < getNeeds().length; i++) { -// needs.get(i).setID(i); -// } -// } - - public Need[] findNeeds(String name) throws IOException { - return dao.findNeeds(name); - } - - public Need updateNeed(Need need) throws IOException { - return dao.updateNeed(need); - } - - public void removeNeed(int id) throws IOException { - dao.deleteNeed(id); - } - - public void removeNeed(String name) throws IOException { - for (Need need : getNeeds()) { - if (need.getName().equals(name)) { - dao.deleteNeed(need.getId()); - return; - } - } - } - - public Need[] getNeeds() throws IOException { - return dao.getNeeds(); - } - - public Need getNeed(int id) throws IOException { - return dao.getNeed(id); - } - -} -- cgit v1.2.3