From 16f5527ec28b4b2eb25a90d5cd4bb873daad7b18 Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Tue, 6 Feb 2024 17:45:54 +0100 Subject: [PATCH 1/9] Added Admin Class --- src/main/java/org/example/Admin.java | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/main/java/org/example/Admin.java diff --git a/src/main/java/org/example/Admin.java b/src/main/java/org/example/Admin.java new file mode 100644 index 0000000..9087727 --- /dev/null +++ b/src/main/java/org/example/Admin.java @@ -0,0 +1,4 @@ +package org.example; + +public class Admin { +} From 5bc65c7608d098b8228e6d474748aaf8b3c5d52f Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Tue, 6 Feb 2024 17:48:37 +0100 Subject: [PATCH 2/9] Added parameters to Admin Class --- src/main/java/org/example/Admin.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/example/Admin.java b/src/main/java/org/example/Admin.java index 9087727..0debc55 100644 --- a/src/main/java/org/example/Admin.java +++ b/src/main/java/org/example/Admin.java @@ -1,4 +1,7 @@ package org.example; public class Admin { + public String name; + public String id; + public String role; } From 438bb350cfd9da783ed41d685bafa445f5bb7d85 Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Tue, 6 Feb 2024 17:49:59 +0100 Subject: [PATCH 3/9] Added basic constructor to Admin Class --- src/main/java/org/example/Admin.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/example/Admin.java b/src/main/java/org/example/Admin.java index 0debc55..bdd8b23 100644 --- a/src/main/java/org/example/Admin.java +++ b/src/main/java/org/example/Admin.java @@ -4,4 +4,7 @@ public class Admin { public String name; public String id; public String role; + + public Admin() { + } } From a1e42fb861afbb200c67da01da18599db84293df Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Tue, 6 Feb 2024 17:51:31 +0100 Subject: [PATCH 4/9] Added enhanced constructor to Admin Class --- src/main/java/org/example/Admin.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/example/Admin.java b/src/main/java/org/example/Admin.java index bdd8b23..9b9bc76 100644 --- a/src/main/java/org/example/Admin.java +++ b/src/main/java/org/example/Admin.java @@ -7,4 +7,10 @@ public class Admin { public Admin() { } + + public Admin(String name, String id, String role) { + this.name = name; + this.id = id; + this.role = role; + } } From 71612d2ed1acc46db408a92748b74e3cab32d5ac Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Tue, 6 Feb 2024 17:53:21 +0100 Subject: [PATCH 5/9] Added getters to Admin Class --- src/main/java/org/example/Admin.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/org/example/Admin.java b/src/main/java/org/example/Admin.java index 9b9bc76..62385b3 100644 --- a/src/main/java/org/example/Admin.java +++ b/src/main/java/org/example/Admin.java @@ -13,4 +13,16 @@ public class Admin { this.id = id; this.role = role; } + + public String getName() { + return name; + } + + public String getId() { + return id; + } + + public String getRole() { + return role; + } } From 3ae41ceab720b48f2022471d1cb2c6fa5ee8280e Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Tue, 6 Feb 2024 17:54:44 +0100 Subject: [PATCH 6/9] Added setters to Admin Class --- src/main/java/org/example/Admin.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/example/Admin.java b/src/main/java/org/example/Admin.java index 62385b3..4c0470b 100644 --- a/src/main/java/org/example/Admin.java +++ b/src/main/java/org/example/Admin.java @@ -17,12 +17,20 @@ public class Admin { public String getName() { return name; } - + public void setName(String name) { + this.name = name; + } public String getId() { return id; } - + public void setId(String id) { + this.id = id; + } public String getRole() { return role; } + + public void setRole(String role) { + this.role = role; + } } From 334b22e55e1d708d8d1e99dcda30be097dfb95b6 Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Tue, 6 Feb 2024 17:57:58 +0100 Subject: [PATCH 7/9] Added printAdminInfo to Admin Class --- src/main/java/org/example/Admin.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/example/Admin.java b/src/main/java/org/example/Admin.java index 4c0470b..f33b1c1 100644 --- a/src/main/java/org/example/Admin.java +++ b/src/main/java/org/example/Admin.java @@ -33,4 +33,11 @@ public class Admin { public void setRole(String role) { this.role = role; } + + public void printAdminInfo() + { + System.out.println("Name: " + getName()); + System.out.println("ID: " + getId()); + System.out.println("role: " + getRole()); + } } From 1149fd0ac93dc0e5f002d1bb61422e09f7b9d192 Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Tue, 6 Feb 2024 17:59:21 +0100 Subject: [PATCH 8/9] Refactoring: Admin Class --- src/main/java/org/example/Admin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/example/Admin.java b/src/main/java/org/example/Admin.java index f33b1c1..1da2bfa 100644 --- a/src/main/java/org/example/Admin.java +++ b/src/main/java/org/example/Admin.java @@ -38,6 +38,6 @@ public class Admin { { System.out.println("Name: " + getName()); System.out.println("ID: " + getId()); - System.out.println("role: " + getRole()); + System.out.println("Role: " + getRole()); } } From 0e3339ab64a8202025fd5c753a7fb7440aaee938 Mon Sep 17 00:00:00 2001 From: Tobias Herbert Date: Tue, 6 Feb 2024 18:04:38 +0100 Subject: [PATCH 9/9] Documentation: Admin Class --- src/main/java/org/example/Admin.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/org/example/Admin.java b/src/main/java/org/example/Admin.java index 1da2bfa..abe8cbc 100644 --- a/src/main/java/org/example/Admin.java +++ b/src/main/java/org/example/Admin.java @@ -1,5 +1,8 @@ package org.example; +/** + * Represents an administrative user in the system. + */ public class Admin { public String name; public String id; @@ -8,6 +11,12 @@ public class Admin { public Admin() { } + /** + * + * @param name the name of the admin + * @param id the id of the admin + * @param role the role of the admin in the system (should typically be "Admin") + */ public Admin(String name, String id, String role) { this.name = name; this.id = id; @@ -34,6 +43,10 @@ public class Admin { this.role = role; } + /** + * Prints the basic information of the admin in the console. + * This methods displays the admin´s ID, name and role, providing a quick overview of the admin´s identity + */ public void printAdminInfo() { System.out.println("Name: " + getName());