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.

33 lines
762 B

  1. import java.io.Serializable;
  2. public class Credential implements Serializable {
  3. private String name, password;
  4. private 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. }
  11. public String getName()
  12. {
  13. return this.name;
  14. }
  15. public String getPassword() { return this.password; }
  16. public int getId() { return this.id; }
  17. public void upDatePassword(String newPassword)
  18. {
  19. this.password = newPassword;
  20. }
  21. public void updateUsername(String newUsername)
  22. {
  23. this.name = newUsername;
  24. }
  25. }