/** * Clears a number of flags in a message * * @param flags The flags * @return A reference to the message */ public Message clearFlag(Flag... flags) { if (flags != null) for (Flag flag : flags) if (flag != null) this.flags &= ~flag.value(); return this; }
public static boolean isFlagSet(short flags, Flag flag) { return flag != null && ((flags & flag.value()) == flag.value()); }
/** * Sets a number of flags in a message * * @param flags The flag or flags * @return A reference to the message */ public Message setFlag(Flag... flags) { if (flags != null) for (Flag flag : flags) if (flag != null) this.flags |= flag.value(); return this; }