public int count ( Severity severity ) { int result = 0 ; if ( severity == null ) { return result ; } for ( ValidationMessage < Origin > message : messages ) { if ( severity . equals ( message . getSeverity ( ) ) ) { result ++ ; } } return result ; }
Counts validation messages by its severity .