Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Magne.Stenseng
inf226-2021-inchat
Commits
5f5d0736
Commit
5f5d0736
authored
Nov 14, 2021
by
Magne.Stenseng
Browse files
Replace User.java
parent
c6048c39
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/inf226/inchat/User.java
View file @
5f5d0736
...
...
@@ -6,20 +6,20 @@ import java.time.Instant;
* about a user.
**/
public
final
class
User
{
public
final
String
name
;
public
final
UserName
name
;
public
final
Instant
joined
;
public
User
(
String
name
,
Instant
joined
)
{
public
User
(
UserName
name
,
Instant
joined
)
{
this
.
name
=
name
;
this
.
joined
=
joined
;
}
/**
* Create a new user.
*/
public
static
User
create
(
String
name
)
{
return
new
User
(
name
,
Instant
.
now
());
UserName
newUser
=
new
UserName
(
name
);
return
new
User
(
newUser
,
Instant
.
now
());
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment