public boolean hasMessageOf ( String property , String messageKey ) { assertArgumentNotNull ( "property" , property ) ; assertArgumentNotNull ( "messageKey" , messageKey ) ; final UserMessageItem item = getPropertyItem ( property ) ; return item != null && item . getMessageList ( ) . stream ( ) . anyMatch ( message -> { final String myKey = resolveMessageKey ( messageKey ) ; if ( message . isResource ( ) ) { if ( myKey . equals ( resolveMessageKey ( message . getMessageKey ( ) ) ) ) { return true ; } } else { // direct message if ( message . getValidatorMessageKey ( ) . filter ( vlkey -> resolveMessageKey ( vlkey ) . equals ( myKey ) ) . isPresent ( ) ) { return true ; } } return false ; } ) ; }
Does the property has user message for the message key?