You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
708 B

  1. public class Credential {
  2. private String name, password;
  3. private int id;
  4. public Credential(String name, String password, int id) throws Exception {
  5. if(name == null || password == null)
  6. throw new Exception("kein leeres Objekt erstellen");
  7. this.name = name;
  8. this.password = password;
  9. }
  10. public String getName()
  11. {
  12. return this.name;
  13. }
  14. public String getPassword() { return this.password; }
  15. public int getId() { return this.id; }
  16. public void upDatePassword(String newPassword)
  17. {
  18. this.password = newPassword;
  19. }
  20. public void updateUsername(String newUsername)
  21. {
  22. this.name = newUsername;
  23. }
  24. }