Created a function to get user attributes, created a main viewer populate method and a method to populate each panel by getting user attributes based on panel name

This commit is contained in:
bobbert committed 2025-04-02 13:12:06 +01:00
1 parent 7b9f08a859
commit 8245777db1
2 files changed
+78

No files matched your search

+14
View File
@@ -8,6 +8,20 @@ public class User {
private String phone;
private String address;
private String getUserAttribute(User user, String panelName) {
return switch (panelName.toLowerCase()) {
case "title" -> user.getTitle();
case "name" -> user.getName();
case "email" -> user.getEmail();
case "phone" -> user.getPhone();
case "address" -> user.getAddress();
default -> "method error";
};
}
//basic getters and setters
public String getAddress() {
return address;