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:
1 parent
7b9f08a859
commit
8245777db1
2 files changed
+78
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user