This repository has been archived on 2022-06-01. You can view files and clone it, but cannot push or open issues or pull requests.
LinkDitch/3-Domain/src/main/java/user/Username.java

13 lines
271 B
Java
Raw Normal View History

2022-03-06 15:56:46 +01:00
package user;
2022-03-29 11:04:47 +02:00
import exeptions.IllegalValueObjectArgument;
2022-03-06 15:56:46 +01:00
public record Username(String username) {
2022-03-29 11:04:47 +02:00
public Username {
if (username.isBlank() || username.isEmpty()) {
throw new IllegalValueObjectArgument("A username must be a valid non-empty string.");
}
}
2022-03-06 15:56:46 +01:00
}