Enum Message.MessageFlag

    • Enum Constant Detail

      • CROSSPOSTED

        public static final Message.MessageFlag CROSSPOSTED
        The Message has been published to subscribed Channels (via Channel Following)
      • IS_CROSSPOST

        public static final Message.MessageFlag IS_CROSSPOST
        The Message originated from a Message in another Channel (via Channel Following)
      • SOURCE_MESSAGE_DELETED

        public static final Message.MessageFlag SOURCE_MESSAGE_DELETED
        Indicates, that the source message of this crosspost was deleted. This should only be possible in combination with IS_CROSSPOST
      • URGENT

        public static final Message.MessageFlag URGENT
        Indicates, that this Message came from the urgent message system
      • EPHEMERAL

        public static final Message.MessageFlag EPHEMERAL
        Indicates, that this Message is ephemeral, the Message is only visible to the bot and the interacting user
        See Also:
        Message.isEphemeral()
      • LOADING

        public static final Message.MessageFlag LOADING
        Indicates, that this Message is an interaction response and the bot is "thinking"
    • Method Detail

      • values

        public static Message.MessageFlag[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Message.MessageFlag c : Message.MessageFlag.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Message.MessageFlag valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getValue

        public int getValue()
        Returns the value of the MessageFlag as represented in the bitfield. It is always a power of 2 (single bit)
        Returns:
        Non-Zero bit value of the field
      • fromBitField

        @Nonnull
        public static EnumSet<Message.MessageFlag> fromBitField​(int bitfield)
        Given a bitfield, this function extracts all Enum values according to their bit values and returns an EnumSet containing all matching MessageFlags
        Parameters:
        bitfield - Non-Negative integer representing a bitfield of MessageFlags
        Returns:
        Never-Null EnumSet of MessageFlags being found in the bitfield
      • toBitField

        public static int toBitField​(@Nonnull
                                     Collection<Message.MessageFlag> coll)
        Converts a Collection of MessageFlags back to the integer representing the bitfield. This is the reverse operation of fromBitField(int).
        Parameters:
        coll - A Non-Null Collection of MessageFlags
        Returns:
        Integer value of the bitfield representing the given MessageFlags
        Throws:
        IllegalArgumentException - If the provided Collection is null