diff --git a/src/main/java/org/example/Admin.java b/src/main/java/org/example/Admin.java index db20809..f8ad460 100644 --- a/src/main/java/org/example/Admin.java +++ b/src/main/java/org/example/Admin.java @@ -58,6 +58,11 @@ public class Admin { System.out.println("Role: " + getRole()); } + /** + * + * @param admin the data of this admin is being written to the file + * @param filename the name of the file to write the data to + */ public void writeToFile(Admin admin, String filename) throws IOException{ try(BufferedWriter writer = new BufferedWriter(new FileWriter(filename))){ String attributes = admin.getName() + "\n" + admin.getId() + "\n" + admin.getRole(); @@ -65,6 +70,12 @@ public class Admin { } } + + /** + * + * @param filename the name of the file to read the data from + * @return the list of admins that have been read from the file + */ public static List readFromFile(String filename) { List admins = new ArrayList<>();