
com.ktanx.common.validation.ValidationResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ktanx-common Show documentation
Show all versions of ktanx-common Show documentation
Ktanx is a java development kit.
The newest version!
package com.ktanx.common.validation;
import java.util.ArrayList;
import java.util.List;
/**
* 验证结果
*
*/
public class ValidationResult {
/**
* 是否成功
*/
private boolean isSuccess;
/**
* 验证错误
*/
private List errors;
public ValidationResult(boolean isSuccess) {
this.isSuccess = isSuccess;
}
public boolean isSuccess() {
return isSuccess;
}
public void setIsSuccess(boolean isSuccess) {
this.isSuccess = isSuccess;
}
/**
* 添加错误
*
* @param error 错误
*/
public void addError(ValidationError error) {
if (errors == null) {
errors = new ArrayList();
}
errors.add(error);
}
public List getErrors() {
return errors;
}
// public int getTimeElapsed() {
// return timeElapsed;
// }
//
// public void setTimeElapsed(int timeElapsed) {
// this.timeElapsed = timeElapsed;
// }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy