public static ElkMessage deserialize(String message) { Matcher matcher = PATTERN_.matcher(message); if (matcher.find()) { // the first group is the type, the second is the body. this should // hold no matter which pattern we use. String type = matcher.group(1); String body = matcher.group(2); return new ElkMessage(body, type); } return null; }
String messageType; if (message instanceof ElkMessage) { messageType = ((ElkMessage) message).getMessageType(); if (ignoredMessageTypes.contains(messageType)) { return false;