public class BeanValidationResult extends Object
Modifier and Type | Class and Description |
---|---|
static class |
BeanValidationResult.ErrorMessage
错误消息,包括字段名(字段路径)、消息内容和字段值
|
Constructor and Description |
---|
BeanValidationResult(boolean success)
构造
|
Modifier and Type | Method and Description |
---|---|
BeanValidationResult |
addErrorMessage(BeanValidationResult.ErrorMessage errorMessage)
增加错误信息
|
List<BeanValidationResult.ErrorMessage> |
getErrorMessages()
获取错误信息列表
|
boolean |
isSuccess()
是否验证通过
|
BeanValidationResult |
setErrorMessages(List<BeanValidationResult.ErrorMessage> errorMessages)
设置错误信息列表
|
BeanValidationResult |
setSuccess(boolean success)
设置是否通过
|
public BeanValidationResult(boolean success)
success
- 是否验证成功public boolean isSuccess()
public BeanValidationResult setSuccess(boolean success)
success
- 是否通过public List<BeanValidationResult.ErrorMessage> getErrorMessages()
public BeanValidationResult setErrorMessages(List<BeanValidationResult.ErrorMessage> errorMessages)
errorMessages
- 错误信息列表public BeanValidationResult addErrorMessage(BeanValidationResult.ErrorMessage errorMessage)
errorMessage
- 错误信息Copyright © 2024. All rights reserved.