mirror of
https://gitee.com/san-bing/JChargePointProtocol
synced 2026-05-04 09:59:55 +08:00
cleanup code
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user