13 lines
271 B
Java
13 lines
271 B
Java
package user;
|
|
|
|
import exeptions.IllegalValueObjectArgument;
|
|
|
|
public record Username(String username) {
|
|
|
|
public Username {
|
|
if (username.isBlank() || username.isEmpty()) {
|
|
throw new IllegalValueObjectArgument("A username must be a valid non-empty string.");
|
|
}
|
|
}
|
|
}
|