@Test public void testSerializeFlags() { Set<Flag> flags = new HashSet<Flag>(); flags.add(Flag.O); flags.add(Flag.K); flags.add(Flag.o); flags.add(Flag.L); flags.add(Flag.V); flags.add(Flag.ANYONE); String serialized = fp.serializeFlags(flags); char[] fl = serialized.toCharArray(); Arrays.sort(fl); serialized = String.valueOf(fl); assertEquals("KLOVo", serialized); }
protected String serializeFlags(Set<Flag> flags) { String result = ""; for (Flag f : flags) { if (f == Flag.ANYONE) { continue; } result += f; } return result; }
FlagsPlugin implements PluginWithDependencies { protected String serializeFlags(Set<Flag> flags) { String result = ""; for (Flag f : flags) { if (f == Flag.ANYONE) { continue; } result += f; } return result; } }
FlagsPlugin implements PluginWithDependencies { protected String serializeFlags(Set<Flag> flags) { String result = ""; for (Flag f : flags) { if (f == Flag.ANYONE) { continue; } result += f; } return result; } FlagsPlugin(); }
FlagsPlugin implements PluginWithDependencies { protected String serializeFlags(Set<Flag> flags) { String result = ""; for (Flag f : flags) { if (f == Flag.ANYONE) { continue; } result += f; } 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 String serializeFlags(Set<Flag> flags) { String result = ""; for (Flag f : flags) { if (f == Flag.ANYONE) { continue; } result += f; } 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);  }