cleanup code

This commit is contained in:
三丙
2024-10-10 10:41:13 +08:00
parent 443cf0abe9
commit 966b683b76

View File

@@ -11,14 +11,12 @@ import java.util.function.Function;
public class Validator {
public static void validateString(String val, String errorMessage) {
if (val == null || val.isEmpty()) {
throw new IncorrectParameterException(errorMessage);
}
}
public static void validateString(String val, Function<String, String> errorMessageFunction) {
if (val == null || val.isEmpty()) {
throw new IncorrectParameterException(errorMessageFunction.apply(val));
@@ -31,13 +29,6 @@ public class Validator {
}
}
@Deprecated
public static void validateId(UUID id, String errorMessage) {
if (id == null) {
throw new IncorrectParameterException(errorMessage);
}
}
public static void validateId(UUID id, Function<UUID, String> errorMessageFunction) {
if (id == null) {
throw new IncorrectParameterException(errorMessageFunction.apply(id));