org.unitils.objectvalidation.utils
Class Utils
java.lang.Object
org.unitils.objectvalidation.utils.Utils
public final class Utils
- extends Object
Utility methods for the validation module.
- Since:
- Oct 10, 2013
- Author:
- Matthieu Mestrez
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
findOneAndOnlyFieldForAnnotation
public static <T> List<Field> findOneAndOnlyFieldForAnnotation(Class<? extends Object> classContainingField,
Class<? extends Annotation> annotation,
Class<T> fieldType)
- Will look in the test class to find a field of type 'fieldType' annotated with 'annotation'
- Parameters:
classContainingField - annotation - fieldType -
- Returns:
- the field if it exists
- Throws:
IllegalStateException - if there was an error retrieving the field.
toRulesCollection
public static ObjectValidationRulesCollection toRulesCollection(String rulesClassName)
toEqualsHashCodeValidator
public static EqualsHashCodeValidator toEqualsHashCodeValidator(Class<?> classToCast)
toRulesCollection
public static ObjectValidationRulesCollection toRulesCollection(Class<?> classToCast)
instantiate
public static Object instantiate(Class<?> classToInstatiate)
checkNotNull
public static <T> T checkNotNull(T reference,
Object errorMessage)
checkArgument
public static void checkArgument(boolean expression,
Object errorMessage)
Copyright © 2013-2015. All Rights Reserved.