@Test public void testDeserializeFlags() { String flags = "KLOVoQ"; Set<Flag> deserialized; deserialized = fp.deserializeFlags(flags); assertEquals(deserialized.size(), 5); }
protected Set<Flag> deserializeFlags(String flags) { Set<Flag> result = new HashSet<Flag>(); if (flags != null) { for (char c : flags.toCharArray()) { try { Flag f = Flag.valueOf("" + c); result.add(f); } catch (IllegalArgumentException e) { logger.error("Invalid flag recorded: " + c); } } } return result; }
FlagsPlugin implements PluginWithDependencies { protected Set<Flag> deserializeFlags(String flags) { Set<Flag> result = new HashSet<Flag>(); if (flags != null) { for (char c : flags.toCharArray()) { try { Flag f = Flag.valueOf("" + c); result.add(f); } catch (IllegalArgumentException e) { logger.error("Invalid flag recorded: " + c); } } } return result; } }
FlagsPlugin implements PluginWithDependencies { protected Set<Flag> deserializeFlags(String flags) { Set<Flag> result = new HashSet<Flag>(); if (flags != null) { for (char c : flags.toCharArray()) { try { Flag f = Flag.valueOf("" + c); result.add(f); } catch (IllegalArgumentException e) { logger.error("Invalid flag recorded: " + c); } } } return result; } FlagsPlugin(); }
FlagsPlugin implements PluginWithDependencies { protected Set<Flag> deserializeFlags(String flags) { Set<Flag> result = new HashSet<Flag>(); if (flags != null) { for (char c : flags.toCharArray()) { try { Flag f = Flag.valueOf("" + c); result.add(f); } catch (IllegalArgumentException e) { logger.error("Invalid flag recorded: " + c); } } } return result; } FlagsPlugin(); String[] getDependencies(); void loadDependency(Plugin plugin); String getDescription(); void incomingEvent(Event e); void addEventDistributor(EventDistributor eventDistributor); void addWand(Wand wand); boolean isUser(Network network, String username); boolean isSuperuser(Network network, String nick); Set<Flag> getFlags(Network network, String channel, String nick); Set<Flag> getFlags(Network network, String nick); boolean hasFlag(Network network, String channel, String nick, Flag flag); }
FlagsPlugin implements PluginWithDependencies { protected Set<Flag> deserializeFlags(String flags) { Set<Flag> result = new HashSet<Flag>(); if (flags != null) { for (char c : flags.toCharArray()) { try { Flag f = Flag.valueOf("" + c); result.add(f); } catch (IllegalArgumentException e) { logger.error("Invalid flag recorded: " + c); } } } return result; } FlagsPlugin(); String[] getDependencies(); void loadDependency(Plugin plugin); String getDescription(); void incomingEvent(Event e); void addEventDistributor(EventDistributor eventDistributor); void addWand(Wand wand); boolean isUser(Network network, String username); boolean isSuperuser(Network network, String nick); Set<Flag> getFlags(Network network, String channel, String nick); Set<Flag> getFlags(Network network, String nick); boolean hasFlag(Network network, String channel, String nick, Flag flag);  }