为什么要使用Bean Validation?
当我们实现某个接口时,都需要对入参数进行校验。例如下面的代码
public String queryValueByKey(String parmTemplateCode, String conditionName, String conditionKey, String resultName) { checkNotNull(parmTemplateCode, "parmTemplateCode not null" ); checkNotNull(conditionName, "conditionName not null" ); checkNotNull(conditionKey, "conditionKey not null" ); checkNotNull(resultName, "resultName not null" );