public interface Validator {
static boolean checkEmptyOrNull(String string, ApiException apiException) {
if (Objects.isNull(string) || string.trim().isEmpty()) {
throw apiException;
}
return true;
}
static boolean checkEmptyOrNull(int value, ApiException apiException) {
if (value < 1) {
throw apiException;
}
return true;
}
}
Why haven't we just created a class instead of interface? What difference it would make?