protected void checkRequiredCardinality ( List < ValidationWarning > warnings , Class < ? extends ICalProperty > ... classes ) { for ( Class < ? extends ICalProperty > clazz : classes ) { List < ? extends ICalProperty > props = getProperties ( clazz ) ; if ( props . isEmpty ( ) ) { warnings . add ( new ValidationWarning ( 2 , clazz . getSimpleName ( ) ) ) ; continue ; } if ( props . size ( ) > 1 ) { warnings . add ( new ValidationWarning ( 3 , clazz . getSimpleName ( ) ) ) ; continue ; } } }
Utility method for validating that there is exactly one instance of each of the given properties .