Added @NotNull annotations for IdentifierValidator
This commit is contained in:
parent
5ceeb6c893
commit
c89f5c3511
@ -1,18 +1,20 @@
|
||||
package ru.dragonestia.picker.api.util;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class IdentifierValidator {
|
||||
|
||||
private IdentifierValidator() {}
|
||||
|
||||
public static boolean forNode(String nodeId) {
|
||||
public static boolean forNode(@NotNull String nodeId) {
|
||||
return nodeId.matches("^(?!-)[a-z\\d-]{0,31}[a-z\\d](?!-)$");
|
||||
}
|
||||
|
||||
public static boolean forRoom(String roomId) {
|
||||
public static boolean forRoom(@NotNull String roomId) {
|
||||
return roomId.matches("^(?!-)[a-z\\d-]{0,31}[a-z\\d](?!-)$");
|
||||
}
|
||||
|
||||
public static boolean forUser(String username) {
|
||||
public static boolean forUser(@NotNull String username) {
|
||||
return username.matches("^[aA-zZ\\d-.\\s:@_;]{1,64}$");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user