|
|
@ -8,9 +8,9 @@ import java.util.List; |
|
|
|
* Represents an administrative user in the system. |
|
|
|
*/ |
|
|
|
public class Admin { |
|
|
|
public String name; |
|
|
|
public String id; |
|
|
|
public String role; |
|
|
|
public String adminName; |
|
|
|
public String adminId; |
|
|
|
public String adminRole; |
|
|
|
|
|
|
|
public Admin() { |
|
|
|
} |
|
|
@ -22,29 +22,29 @@ public class 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; |
|
|
|
this.role = role; |
|
|
|
this.adminName = name; |
|
|
|
this.adminId = id; |
|
|
|
this.adminRole = role; |
|
|
|
} |
|
|
|
|
|
|
|
public String getName() { |
|
|
|
return name; |
|
|
|
public String getAdminName() { |
|
|
|
return adminName; |
|
|
|
} |
|
|
|
public void setName(String name) { |
|
|
|
this.name = name; |
|
|
|
public void setAdminName(String adminName) { |
|
|
|
this.adminName = adminName; |
|
|
|
} |
|
|
|
public String getId() { |
|
|
|
return id; |
|
|
|
public String getAdminId() { |
|
|
|
return adminId; |
|
|
|
} |
|
|
|
public void setId(String id) { |
|
|
|
this.id = id; |
|
|
|
public void setAdminId(String adminId) { |
|
|
|
this.adminId = adminId; |
|
|
|
} |
|
|
|
public String getRole() { |
|
|
|
return role; |
|
|
|
public String getAdminRole() { |
|
|
|
return adminRole; |
|
|
|
} |
|
|
|
|
|
|
|
public void setRole(String role) { |
|
|
|
this.role = role; |
|
|
|
public void setAdminRole(String adminRole) { |
|
|
|
this.adminRole = adminRole; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -53,9 +53,9 @@ public class Admin { |
|
|
|
*/ |
|
|
|
public void printAdminInfo() |
|
|
|
{ |
|
|
|
System.out.println("Name: " + getName()); |
|
|
|
System.out.println("ID: " + getId()); |
|
|
|
System.out.println("Role: " + getRole()); |
|
|
|
System.out.println("Name: " + getAdminName()); |
|
|
|
System.out.println("ID: " + getAdminId()); |
|
|
|
System.out.println("Role: " + getAdminRole()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -65,7 +65,7 @@ public class Admin { |
|
|
|
*/ |
|
|
|
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(); |
|
|
|
String attributes = admin.getAdminName() + "\n" + admin.getAdminId() + "\n" + admin.getAdminRole(); |
|
|
|
writer.write(attributes); |
|
|
|
} |
|
|
|
|
|
|
|