Skip to content

Commit 1a3c77d

Browse files
committed
Merge remote-tracking branch 'origin/15-userdatabase-and-user' into 15-userdatabase-and-user
2 parents 4e4d422 + 4985929 commit 1a3c77d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/main/java/User.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import java.io.Serializable;
2-
public abstract class User implements Serializable{
2+
public abstract class User implements Serializable, Changeable{
33
protected String username;
44
protected String password;
55
protected String email;
@@ -20,4 +20,16 @@ private String getPassword(){
2020
return this.password;
2121
}
2222

23+
@Override
24+
// from Changeable
25+
public void changeFeature(String feature, String newFeature){
26+
if (feature == "Username"){
27+
this.username = newFeature;
28+
} else if (feature == "Password"){
29+
this.password = newFeature;
30+
} else if (feature == "Email"){
31+
this.email = newFeature;
32+
}
33+
}
34+
2335
}

src/main/java/UserDatabase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public boolean UserExists(String username, String email) {
2525
}
2626
return user != null;
2727
}
28+
// TODO: create userExists that takes 1 parameter: username.
2829

2930
// Creates a new user with a username and password, and an email address
3031
// The order is username, password, email address, verification status, status

0 commit comments

Comments
 (0)