当我尝试返回此验证结果时,vscode 出现问题,我看到视频中代码运行良好的人有所不同。
public interface CustomerRegistrationsValidator extends Function<Customer, ValidationResult> {
static CustomerRegistrationsValidator isValid() {
return customer -> customer.getEmail().contains("@")? ValidationResult.EMAIL_IS_NOT_VALID: ValidationResult.SUCCES;
}
enum ValidationResult {
SUCCES,
EMAIL_IS_NOT_VALID,
}
}
“This lambda expression refers to the missing type ValidationResult” 这是我在 isValid() 中得到的错误