@Test public void testGetMessageLevel() { HashMap<String, Message.MessageLevel> tagLevels = new HashMap<>(); tagLevels.put("foo", Message.MessageLevel.INFO); tagLevels.put("bar", Message.MessageLevel.ERROR); for (String tag : tagLevels.keySet()) { Message m = new Message( "text", Collections.singleton(tag), tagLevels.get(tag), Duration.ofMinutes(10)); env.addMessage(m); } assertEquals(Message.MessageLevel.ERROR.toString(), MessagesUtils.getMessageLevel(tagLevels.keySet().toArray(new String[0]))); }
public static String getMessageLevel(String... tags) { Set<MessagesContainer.AcceptedMessage> messages; RuntimeEnvironment env = RuntimeEnvironment.getInstance(); messages = Arrays.stream(tags). map(env::getMessages). flatMap(Collection::stream). collect(Collectors.toSet()); return getHighestMessageLevel(messages); }
MessagesUtils { public static String getMessageLevel(String... tags) { Set<MessagesContainer.AcceptedMessage> messages; RuntimeEnvironment env = RuntimeEnvironment.getInstance(); messages = Arrays.stream(tags). map(env::getMessages). flatMap(Collection::stream). collect(Collectors.toSet()); return getHighestMessageLevel(messages); } }
MessagesUtils { public static String getMessageLevel(String... tags) { Set<MessagesContainer.AcceptedMessage> messages; RuntimeEnvironment env = RuntimeEnvironment.getInstance(); messages = Arrays.stream(tags). map(env::getMessages). flatMap(Collection::stream). collect(Collectors.toSet()); return getHighestMessageLevel(messages); }  }
MessagesUtils { public static String getMessageLevel(String... tags) { Set<MessagesContainer.AcceptedMessage> messages; RuntimeEnvironment env = RuntimeEnvironment.getInstance(); messages = Arrays.stream(tags). map(env::getMessages). flatMap(Collection::stream). collect(Collectors.toSet()); return getHighestMessageLevel(messages); }  static void printMessages(Writer out, SortedSet<MessagesContainer.AcceptedMessage> set); static String messagesToJson(String... tags); static String messagesToJson(Project project, String... additionalTags); static String messagesToJson(Project project); static String messagesToJson(Group group); static String getMessageLevel(String... tags); }
MessagesUtils { public static String getMessageLevel(String... tags) { Set<MessagesContainer.AcceptedMessage> messages; RuntimeEnvironment env = RuntimeEnvironment.getInstance(); messages = Arrays.stream(tags). map(env::getMessages). flatMap(Collection::stream). collect(Collectors.toSet()); return getHighestMessageLevel(messages); }  static void printMessages(Writer out, SortedSet<MessagesContainer.AcceptedMessage> set); static String messagesToJson(String... tags); static String messagesToJson(Project project, String... additionalTags); static String messagesToJson(Project project); static String messagesToJson(Group group); static String getMessageLevel(String... tags);  }