import javax.validation.ConstraintValidator;\r
import javax.validation.ConstraintValidatorContext;\r
\r
+/**\r
+ * A Mock class for testing entity validation tasks. DO NOT MODIFY UNLESS YOU\r
+ * ALSO MODIFY THE UNIT TESTS MAKING USE OF THIS CLASS!\r
+ *\r
+ * @author ayco_holleman\r
+ *\r
+ */\r
public class CheckCaseValidator implements ConstraintValidator<CheckCase, String> {\r
private CaseMode caseMode;\r
\r
\r
- public void initialize(CheckCase constraintAnnotation){\r
+ @Override\r
+ public void initialize(CheckCase constraintAnnotation){\r
this.caseMode = constraintAnnotation.value();\r
}\r
\r
\r
- public boolean isValid(String object, ConstraintValidatorContext constraintContext){\r
- if (object == null)\r
- return true;\r
- if (caseMode == CaseMode.UPPER)\r
- return object.equals(object.toUpperCase());\r
- else\r
- return object.equals(object.toLowerCase());\r
+ @Override\r
+ public boolean isValid(String object, ConstraintValidatorContext constraintContext){\r
+ if (object == null) {\r
+ return true;\r
+ }\r
+ if (caseMode == CaseMode.UPPER) {\r
+ return object.equals(object.toUpperCase());\r
+ } else {\r
+ return object.equals(object.toLowerCase());\r
+ }\r
}\r
}\r