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.

34 lines
790 B

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