Browse Source

Rewrite ValueObject to DTO since we don't want to destroy the old object each time it gets updated

feature-credentialneu
fdai5728 3 years ago
parent
commit
0bfd2875fe
  1. 9
      src/main/java/Credential.java
  2. 2
      src/main/java/CredentialRepository.java

9
src/main/java/Credential.java

@ -1,9 +1,5 @@
public class Credential { public class Credential {
/**
* Value Object für das Tupel aus name + pw
*/
private String name, password; private String name, password;
private int id; private int id;
@ -27,4 +23,9 @@ public class Credential {
{ {
this.password = newPassword; this.password = newPassword;
} }
public void updateUsername(String newUsername)
{
this.name = newUsername;
}
} }

2
src/main/java/CredentialRepository.java

@ -62,6 +62,8 @@ public class CredentialRepository implements CredentialRepositoryInterface{
@Override @Override
public void updatePassword(int index) { public void updatePassword(int index) {
} }
public void updateUsername(int index){ public void updateUsername(int index){

Loading…
Cancel
Save