File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import java .util .ArrayList ;
4
4
5
- public class UserAppScreenGateway {
5
+ public class UserAppScreenGateway implements Username {
6
6
7
7
private final UserDataBase userDataBase ;
8
8
private String username ;
@@ -21,9 +21,18 @@ public UserAppScreenGateway(UserDataBase userDataBase){
21
21
* @param user The current user
22
22
*/
23
23
public void login (User user ){
24
- this .username = user . getUsername ();
24
+ this .username = getUsername (user );
25
25
this .userChats = userDataBase .getUserChats (this .username );
26
26
AppScreenLoader appScreenLoader = new AppScreenLoader (this .username , this .userChats );
27
27
}
28
28
29
+ /**
30
+ * Get the username of the user
31
+ * @param user The current user
32
+ * @return Username of the user
33
+ */
34
+ @ Override
35
+ public String getUsername (User user ) {
36
+ return user .getUsername ();
37
+ }
29
38
}
Original file line number Diff line number Diff line change
1
+ package appscreen ;
2
+
3
+ public interface Username {
4
+ String getUsername (User user );
5
+ }
You can’t perform that action at this time.
0 commit comments