1 package org.kuali.student.common.ui.client.validator;
2
3 import java.util.List;
4
5 import org.kuali.student.common.validation.dto.ValidationResultInfo;
6 import org.kuali.student.common.validation.dto.ValidationResultInfo.ErrorLevel;
7
8 public class ValidatorClientUtils {
9
10
11
12
13
14
15
16
17 public static boolean hasErrors(List<ValidationResultInfo> validationResults){
18 if (validationResults !=null){
19 for (ValidationResultInfo vr:validationResults){
20 if (vr.getErrorLevel() == ErrorLevel.ERROR){
21 return true;
22 }
23 }
24 }
25
26 return false;
27 }
28
29
30
31
32
33
34
35 public static boolean hasWarnings(List<ValidationResultInfo> validationResults){
36 if (validationResults !=null){
37 for (ValidationResultInfo vr:validationResults){
38 if (vr.getErrorLevel() == ErrorLevel.WARN){
39 return true;
40 }
41 }
42 }
43
44 return false;
45 }
46
47 }