public static < T extends ParamValidator > T getValidator ( Class < T > clazz , boolean required ) { List < ParamValidator > validators = validatorsMap . get ( clazz ) ; if ( validators != null ) { if ( required ) { return ( T ) validators . get ( 0 ) ; } return ( T ) validators . get ( 1 ) ; } return null ; }
return the relevant Validator by the given class type and required indication