Commit 5f5d0736 authored by Magne.Stenseng's avatar Magne.Stenseng
Browse files

Replace User.java

parent c6048c39
......@@ -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());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment