import java.io.Serializable; public class Credential implements Serializable { private String name, password; private final int id; public Credential(String name, String password, int id) throws Exception { if(name == null || password == null) throw new Exception("kein leeres Objekt erstellen"); this.name = name; this.password = password; this.id = id; } public String getName() { return this.name; } public String getPassword() { return this.password; } public int getId() { return this.id; } public void upDatePassword(String newPassword) { this.password = newPassword; } public void updateUsername(String newUsername) { this.name = newUsername; } }