From efd3b3399894df879687e7384317b2331f15b947 Mon Sep 17 00:00:00 2001 From: fdai7887 Date: Tue, 6 Feb 2024 20:43:28 +0100 Subject: [PATCH] Added findAdminbyId Method to Administration class --- src/main/java/org/example/Administration.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/org/example/Administration.java b/src/main/java/org/example/Administration.java index 53a69b8..0f838dc 100644 --- a/src/main/java/org/example/Administration.java +++ b/src/main/java/org/example/Administration.java @@ -67,6 +67,19 @@ public class Administration { return null; } + public Admin findAdminById(String adminId) + { + for(Admin admin :admins) + { + if(admin.getId().equals(adminId)) + { + return admin; + } + } + + return null; + } + /** * * @param adminID the id of the admin you want to be deleted from the system