public List < ValidationMessage < Origin > > getMessages ( String messageKey , Severity severity ) { List < ValidationMessage < Origin >> messages = new ArrayList < ValidationMessage < Origin > > ( ) ; for ( ValidationResult result : results ) { for ( ValidationMessage < Origin > message : result . getMessages ( ) ) { if ( messageKey . equals ( message . getMessageKey ( ) ) && severity . equals ( message . getSeverity ( ) ) ) { messages . add ( message ) ; } } } return messages ; }
Finds validation messages by the message key and severity .