Finds validation messages by the message key.

@param messageKey a message key of the message
@return a collection of found validation messages
321762
public Collection<ValidationMessage<Origin>> getMessages(String messageKey) {

		Collection<ValidationMessage<Origin>> result = new ArrayList<ValidationMessage<Origin>>();

		for (ValidationMessage<Origin> message : messages) {
			if (messageKey.equals(message.getMessageKey())) {
				result.add(message);
			}
		}
		return result;
	}
521044
public Collection<Message> getAll() {
        final int firstMessagePosition = this.getFirstPosition();
        if (firstMessagePosition < MessageStore.INITIAL_MESSAGE_POSITION) {
            return Collections.unmodifiableList(Collections.emptyList());
        }
        return this.getFrom(firstMessagePosition);
    }
606114
@Override
    public String key(String key, Object[] args) {

        if (hasConfigValue(key)) {
            return getConfigValue(key, args);
        }
        return m_messages.key(key, args);
    }
418007
public synchronized Message[] getByIds(final long start, final long end/* final Folder folder*/) {
        checkExists();
        final List<MockMessage> sms = new ArrayList<MockMessage>();
        int num = 0;

        MockMessage lastMsg = null;

        for (final MockMessage mockMessage : new TreeSet<MockMessage>(messages.values())) {

            lastMsg = mockMessage;

            if (end == UIDFolder.LASTUID) {
                if (getMessageCount() != 1 && mockMessage.getMockid() < start) { // TODO
                                                                                 // check?
                    continue;
                }
            } else {
                if (mockMessage.getMockid() < start || mockMessage.getMockid() > end) {
                    continue;
                }
            }

            mockMessage.setMessageNumber(++num);
            // mockMessage.setFolder(folder);
            sms.add(mockMessage);
        }

        if (end == UIDFolder.LASTUID && sms.size() == 0) {
            lastMsg.setMessageNumber(++num);
            // lastMsg.setFolder(folder);
            sms.add(lastMsg);
        }

        logger.debug("getByIds(" + start + "," + end + " for " + getFullName() + " returns " + sms.size());
        return sms.toArray(new Message[sms.size()]);
    }
1069470
public List<MessageValidator<? extends ValidationContext>> findMessageValidators(String messageType, Message message) {
        List<MessageValidator<? extends ValidationContext>> matchingValidators = new ArrayList<>();

        for (MessageValidator<? extends ValidationContext> validator : messageValidators) {
            if (validator.supportsMessageType(messageType, message)) {
                matchingValidators.add(validator);
            }
        }

        if (matchingValidators.isEmpty() || matchingValidators.stream().allMatch(validator -> DefaultMessageHeaderValidator.class.isAssignableFrom(validator.getClass()))) {
            // try to find fallback message validator for given message payload
            if (message.getPayload() instanceof String &&
                    StringUtils.hasText(message.getPayload(String.class))) {
                String payload = message.getPayload(String.class).trim();

                if (payload.startsWith("<") && !messageType.equals(MessageType.XML.name())) {
                    matchingValidators = findFallbackMessageValidators(MessageType.XML.name(), message);
                } else if ((payload.trim().startsWith("{") || payload.trim().startsWith("[")) && !messageType.equals(MessageType.JSON.name())) {
                    matchingValidators = findFallbackMessageValidators(MessageType.JSON.name(), message);
                } else if (!messageType.equals(MessageType.PLAINTEXT.name())) {
                    matchingValidators = findFallbackMessageValidators(MessageType.PLAINTEXT.name(), message);
                }
            }
        }

        if (matchingValidators.isEmpty() || matchingValidators.stream().allMatch(validator -> DefaultMessageHeaderValidator.class.isAssignableFrom(validator.getClass()))) {
            throw new CitrusRuntimeException("Could not find proper message validator for message type '" +
                    messageType + "', please define a capable message validator for this message type");
        }

        if (log.isDebugEnabled()) {
            log.debug(String.format("Found %s message validators for message type: %s", matchingValidators.size(), messageType));
        }
        
        return matchingValidators;
    }
493033
protected function getMessagesForWildcardKey($key, $format)
    {
        return collect($this->messages)
                ->filter(function ($messages, $messageKey) use ($key) {
                    return Str::is($key, $messageKey);
                })
                ->map(function ($messages, $messageKey) use ($format) {
                    return $this->transform(
                        $messages, $this->checkFormat($format), $messageKey
                    );
                })->all();
    }
11558
protected function getTranslatedMessages(array $messageKeys, $locale)
    {
        $translatedMessages = [];

        foreach ($messageKeys as $key) {
            $translation = Lang::get($key, [], $locale);

            if (is_array($translation)) {
                $flattened = $this->flattenTranslations($translation, $key.'.');
                $translatedMessages = array_merge($translatedMessages, $flattened);
            } else {
                $translatedMessages[$key] = $translation;
            }
        }

        return $translatedMessages;
    }
272342
public static final void recordKeyHistory(List<Object> baseMessage, Object messageKey)
    {
        KeyHistory history = new KeyHistory();

        if (messageKey != null)
        {
            history.addKey(messageKey.toString());
        }

        baseMessage.add(0, history);
    }
200488
protected CmsMessages getMessages() {

        if (m_messages == null) {
            // initialize the localized messages
            m_messages = new CmsMessages(Messages.get().getBundleName(), getLocale().toString());
        }
        return m_messages;
    }
800498
public List<ValidatorElement> getAllValidatorElements() {
        List<ValidatorElement> ret = CollectionUtil.createArrayList();
        for (ListAble<ValidatorElement> e : validatorElementLinkedList) {
            ret.addAll(e.getAsList());
        }
        return ret;
    }
1354233
public static ValidationException warning(String messageKey, 
			Object... params) {
		return new ValidationException(
				ValidationMessage.warning(messageKey, params));		
	}
1058743
public static List<Audit> findByMessage(EntityManager em, String message) {
        requireArgument(em != null, "Entity manager cannot be null.");
        requireArgument(message != null && !message.isEmpty(), "Message cannot be null or empty.");

        TypedQuery<Audit> query = em.createNamedQuery("Audit.findByMessage", Audit.class);

        try {
            query.setParameter("message", "%" + message + "%");
            return query.getResultList();
        } catch (Exception ex) {
            return new ArrayList<Audit>(0);
        }
    }
598871
protected String getMessage(String key, Object[] params){
		MessageSource messageSource = ValkyrieRepository.getInstance().getApplicationConfig().messageSource();
		return messageSource.getMessage(key, params, Locale.getDefault());
	}
426777
public java.util.List<ValidationError> getValidationErrors() {
        if (validationErrors == null) {
            validationErrors = new com.amazonaws.internal.SdkInternalList<ValidationError>();
        }
        return validationErrors;
    }
1073133
@Deprecated
    public @Nonnull
    String getMessage(String key) {
        BugPattern bugPattern = DetectorFactoryCollection.instance().lookupBugPattern(key);
        if (bugPattern == null) {
            return L10N.getLocalString("err.missing_pattern", "Error: missing bug pattern for key") + " " + key;
        }
        return bugPattern.getAbbrev() + ": " + bugPattern.getLongDescription();
    }
271812
public static ValidationMessage<Origin> warning(String messageKey, Object... params) {
		return ValidationMessage.message(Severity.WARNING, messageKey, params);
	}
910580
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;
        });
    }